0% found this document useful (0 votes)
12 views2 pages

Offline JavaScript Practice Workbook

The document is an offline JavaScript practice workbook designed to help users learn JavaScript through various exercises. It covers topics such as variables, functions, arrays, objects, and conditions, providing step-by-step instructions and solutions for each question. Additionally, it includes mini practice tasks for further skill development.

Uploaded by

paulathejennifer
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)
12 views2 pages

Offline JavaScript Practice Workbook

The document is an offline JavaScript practice workbook designed to help users learn JavaScript through various exercises. It covers topics such as variables, functions, arrays, objects, and conditions, providing step-by-step instructions and solutions for each question. Additionally, it includes mini practice tasks for further skill development.

Uploaded by

paulathejennifer
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

Offline JavaScript Practice Workbook

This PDF helps you learn JavaScript fully offline. Read each question, follow the steps, then
practice in VS Code or [Link].

Section 1: Variables & Data Types

Q1. Create a variable called age and print it.


Steps: Use let, assign a number, print using [Link].
Solution: let age = 22; [Link](age);
Q2. Store your name and whether you are a student.
Solution: let name = "Jennifer"; let isStudent = true;

Section 2: Functions

Q3. Write a function that adds two numbers.


Steps: Use function keyword, parameters, return result.
Solution: function add(a,b){ return a+b; }
Q4. Write a function that greets a user.
Solution: function greet(name){ [Link]("Hello " + name); }

Section 3: Arrays

Q5. Create an array of foods and print the first item.


Solution: let foods = ["Rice","Chicken","Fruit"]; [Link](foods[0]);
Q6. Loop through an array and print each item.
Solution: for(let i=0;i<[Link];i++){ [Link](foods[i]); }

Section 4: Objects

Q7. Create an object with name, age, and job.


Solution: let person = { name:"Jennifer", age:22, job:"Student" };

Section 5: Conditions

Q8. Check if a number is greater than 10.


Solution: let num = 15; if(num>10){ [Link]('Greater than 10'); }

Mini Practice Tasks

Task 1: Write a function that checks if a number is even or odd.


Task 2: Write a function that reverses a string.

You might also like