0% found this document useful (0 votes)
7 views

JavaScript_Practice_Week1_Week2

The document outlines a JavaScript practice workbook for Weeks 1 and 2, covering fundamental concepts such as variables, functions, loops, and arrays in Week 1. Week 2 introduces intermediate topics including objects, destructuring, spread/rest operators, DOM manipulation, and event listeners. Each section includes specific practice exercises to reinforce learning and application of the concepts.

Uploaded by

ajay.tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

JavaScript_Practice_Week1_Week2

The document outlines a JavaScript practice workbook for Weeks 1 and 2, covering fundamental concepts such as variables, functions, loops, and arrays in Week 1. Week 2 introduces intermediate topics including objects, destructuring, spread/rest operators, DOM manipulation, and event listeners. Each section includes specific practice exercises to reinforce learning and application of the concepts.

Uploaded by

ajay.tiwari
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

JavaScript Practice Workbook - Week 1 & Week 2

Week 1: JavaScript Basics - Practice & Exercises

- Variables & Data Types (var, let, const)

- Practice:

1. Declare variables for name, age, isStudent.

2. Try re-assigning values to let vs const.

- Functions + Arrow Functions

- Practice:

1. Write a function that returns square of a number.

2. Convert it to an arrow function.

3. Write a function to return the larger of two numbers.

- Loops (for, while)

- Practice:

1. Print numbers from 1 to 10 using for and while loop.

2. Loop through an array of colors.

- if/else, switch

- Practice:

1. Write a function that checks if a number is positive, negative or zero.

2. Use switch to print day of the week for a number 1-7.

- Arrays (map, filter, reduce)

- Practice:

1. Use map to square each number in an array.

2. Use filter to get even numbers.

3. Use reduce to sum the values.

Week 2: Intermediate JavaScript - Practice & Exercises


JavaScript Practice Workbook - Week 1 & Week 2

- Objects

- Practice:

1. Create a student object with name, age, marks.

2. Write a method to greet using object.

- Destructuring

- Practice:

1. Destructure name and age from student object.

2. Destructure values from an array of fruits.

- Spread/Rest operators

- Practice:

1. Combine two arrays using spread.

2. Create a function that uses rest to accept any number of arguments.

- DOM Manipulation

- Practice (HTML + JS):

1. Change the text of an <h1> element using JS.

2. Toggle the background color of the page on button click.

- Event Listeners + Bubbling

- Practice:

1. Add a click event to a button that shows an alert.

2. Add bubbling example with nested divs and stop propagation.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy