Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 1.61 KB

File metadata and controls

32 lines (22 loc) · 1.61 KB

Week 01 - 1.2 | Basics of Javascript

1. Create Zerodha Clone using HTML and CSS - Zerodha Website Link

2. Variables

  • Create a variable for each of the following: your favorite color, your height in centimeters, and whether you like pizza. Use appropriate variable declarations (let, const, or var). Try logging it using console.log

3. Functions

  • Write a function sum that finds the sum of two numbers.
    • Side quest - Try passing in a string instead of a number and see what happens?
  • Write a function called canVote that returns true or false if the age of a user is > 18

4. If/Else

  • Write an if/else statement that checks if a number is even or odd. If it's even, print "The number is even." Otherwise, print "The number is odd."

5. Loops

  • Write a function called sum that finds the sum from 1 to a number

6. Objects

  • Write a function that takes a user as an input and greets them with their name and age
  • Write a function that takes a new object as input which has name , age and gender and greets the user with their gender (Hi Mr/Mrs/Others harkirat, your age is 21)
  • Also tell the user if they are legal to vote or not

7. Arrays

  • Write a function that takes an array of numbers as input, and returns a new array with only even values. Read about filter in JS

8. Array of Objects

  • Write a function that takes an array of users as inputs and returns only the users who are more than 18 years old

9. Object of Objects

  • Create a function that takes an array of objects as input, and returns the users whose age > 18 and are male