This repository contains various exercises aimed at refreshing JavaScript concepts, including variables, data types, operators, conditional statements, and loops. Below is a summary of what I have learned and the exercises I have completed in each section.
- JavaScript Bootcamp Refresher Tasks
- How to declare and assign values to variables.
- The importance of using meaningful variable names.
- Declared a variable
nameand assigned my name to it. - Declared a variable
ageand assigned my age to it. - Declared a variable
isStudentand assigned a boolean value to it indicating whether I am a student. - Printed all three variables.
- How to reassign values to variables after their initial declaration.
- Declared a variable
favoriteColourand assigned my favorite color to it. - Printed the value of
favoriteColour. - Reassigned
favoriteColourto a different color. - Printed the new value of
favoriteColour.
- Performing basic arithmetic operations: addition, subtraction, multiplication, and division.
- Declared two variables
num1andnum2and assigned them values. - Calculated the sum, difference, product, and quotient of
num1andnum2. - Printed the results of these arithmetic operations.
- Working with different data types: numbers and booleans.
- Using comparison and logical operators.
- Declared a number variable and assigned it a value.
- Declared another number variable and assigned it a floating number.
- Performed addition, subtraction, multiplication, division, modulus, and exponentiation with these numbers.
- Compared two numbers using comparison operators and stored the results in boolean variables.
- Used logical operators (AND, OR, NOT) with boolean variables.
- Used assignment operators to modify a variable's value.
- Using
if-elsestatements andswitchstatements to handle different conditions. - Writing
forloops to iterate over a range of numbers or array elements.
- Checked the temperature and printed messages based on different temperature ranges using
if-elsestatements andswitchstatements. - Checked if a number is divisible by 2, 3, or both using
if-elsestatements andswitchstatements. - Printed numbers from 1 to 10 using a
forloop. - Printed all even numbers between 1 and 20 using a
forloop. - Calculated the sum of all numbers from 1 to 100 using a
forloop. - Printed each element of an array using a
forloop. - Found and printed the largest number in an array using a
forloop.
- Using
whileloops for repeated execution based on a condition.
- Printed numbers from 1 to 10 using a
whileloop. - Printed all even numbers between 1 and 20 using a
whileloop. - Calculated the sum of all numbers from 1 to 100 using a
whileloop. - Printed all multiples of 5 less than 50 using a
whileloop.
- Using
do-whileloops for repeated execution, ensuring the loop runs at least once.
- Printed numbers from 1 to 10 using a
do-whileloop. - Calculated the sum of all numbers from 1 to 100 using a
do-whileloop. - Prompted the user to enter a number greater than 10, continuing to ask until a valid number was entered.
- Created a simple guessing game where the user guesses a number between 1 and 10 until the correct number is guessed.
This bootcamp refresher has helped reinforce my understanding of fundamental JavaScript concepts and improved my coding skills.