Code Monkey home page Code Monkey logo

code-training's Introduction

Starting the project

Install lastest LTS Node version which is 20.11.1 Preferably use NVM program to manage node versions Install yarn globally

1. Go in the main folder where package.json file is

2. Run yarn command which will install all the dependances

3. Run yarn dev to run the project

Project should run on http://localhost:5173/

JavaScript Array Practice Problems

Improve your skills with JavaScript array methods such as map, filter, and reduce by solving the following problems:

1. Capitalize Names

Problem: You have an array of names: ["alice", "bob", "charlie", "david"]. Use the map function to capitalize each name so that they start with a capital letter.

2. Filter Even Numbers

Problem: Given an array of numbers: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], use the filter method to create a new array that contains only the even numbers.

3. Sum of All Numbers

Problem: You have an array of integers: [5, 10, 15, 20, 25]. Use the reduce method to find the sum of all elements in the array.

4. Convert Array of Objects

Problem: Given an array of objects representing people with properties for name and age like [{name: "Alice", age: 25}, {name: "Bob", age: 30}, {name: "Charlie", age: 35}], use the map function to transform this array into an array of strings formatted like "Name is Age years old", e.g., "Alice is 25 years old".

5. Find Maximum Number

Problem: Using the reduce method, find the maximum number in an array [45, 78, 22, 89, 94, 53, 33, 12].

6. Remove Specific Value

Problem: You have an array ["apple", "banana", "cherry", "date", "fig", "grape"]. Use the filter function to create a new array that does not include "date".

7. Count Specific Items

Problem: Count how many times the word "apple" appears in an array ["apple", "banana", "apple", "cherry", "apple"] using the reduce method.

8. Multiply Array Values

Problem: Use the map function to multiply each value in the array [2, 3, 4, 5, 6] by 3.

9. Filter Objects Based on Property

Problem: Given an array of objects [{id: 1, name: "Alice"}, {id: 2, name: "Bob"}, {id: 3, name: "Charlie"}, {id: 4, name: "David"}], use filter to retrieve only those objects where the id is greater than 2.

10. Aggregate Properties

Problem: For an array of objects [{points: 85}, {points: 92}, {points: 88}, {points: 90}], use reduce to calculate the average score.

Part Two

1. Display a card from the list

Problem: Create an react component cardDisplay.jsx that will import the cardData from data/data.js and display the picture of the card.

2. Display all cards from the list in a line

Problem: Create an react component allCardDisplay.jsx that will import the cardData from data/data.js and display the pictures of all card in a row with some spacing between them.

3. Make a page /card/ that will open a page with the specific card

Problem: Create an react component cardCode.jsx that will import the cardData from data/data.js and display the pictures of the card that was passed in the url as the cardCode. You will see inside the data for all card in data.data.js each card has a code. Use the code from the URL for example /card/5S search for that card in the data and display its picture

code-training's People

Contributors

stanislavbozhanov avatar

Watchers

 avatar

Forkers

lapatovamarieta

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.