An object literal representing a part of your musical album collection is given. Each album has a unique id number as its key and several other properties. Not all albums have complete information.
I have started with an updateRecords function that takes an object literal, records, containing the musical album collection, an id, a prop (like artist or tracks), and a value. The function has been created using the rules below to modify the object passed to the function.
The function must always return the entire record collection object.
- If prop isn't tracks and value isn't an empty string, update or set that album's prop to value.
- If prop is tracks but the album doesn't have a tracks property, create an empty array and add value to it.
- If prop is tracks and value isn't an empty string, add value to the end of the album's existing tracks array.
- If value is an empty string, delete the given prop property from the album.
[Note: A copy of the recordCollection object is used for the tests.]
- HTML
- CSS
- JavaScipt
- Webpack
👤 Bhagyashree Patra
- GitHub: @Vagyasri
- Twitter: @Vagyasri
- LinkedIn: Bhagyashree Patra
- Web browser
- Code Editor (VS Code)
- Live Server Extension
- Copy this link
- Open your terminal or command line
- Run "git clone Paste this link"
- Open the folder with your code editor
- Now You can edit the code and check the changes in the browser using Live Server
- Initialize
npm
: Runnpm init -y
- Install
webpack
andwebpack-cli
locally: Runnpm install webpack webpack-cli --save-dev
- Run:
npm run build
- Run:
npm start
- Run:
npm install --save-dev jest
- Run:
npm run test or npm test
- Install npm
- For HTML: Run npx hint .
- For CSS: Run npx stylelint "**/*.{css,scss}"
- For JS: Run npx eslint .
Contributions, issues, and feature requests are welcome!
Start by:
- Forking the project
- Cloning the project to your local machine
- cd into the Youtube-Replica project directory
- Run git checkout -b your-branch-name
- Make your contributions
- Push your branch up to your forked repository
- Open a Pull Request with a detailed description to the development branch of the original project for a review
Feel free to check the issues page, contribute to the Project by creating an issue.
Give a ⭐️ if you like this project!