Skip to content

Repository files navigation

JavaScript Bootcamp Refresher Tasks

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.

Table of Contents

Variable Declaration

What I Learned

  • How to declare and assign values to variables.
  • The importance of using meaningful variable names.

Exercises

  1. Declared a variable name and assigned my name to it.
  2. Declared a variable age and assigned my age to it.
  3. Declared a variable isStudent and assigned a boolean value to it indicating whether I am a student.
  4. Printed all three variables.

File

Variable Reassignment

What I Learned

  • How to reassign values to variables after their initial declaration.

Exercises

  1. Declared a variable favoriteColour and assigned my favorite color to it.
  2. Printed the value of favoriteColour.
  3. Reassigned favoriteColour to a different color.
  4. Printed the new value of favoriteColour.

File

Arithmetic Operations

What I Learned

  • Performing basic arithmetic operations: addition, subtraction, multiplication, and division.

Exercises

  1. Declared two variables num1 and num2 and assigned them values.
  2. Calculated the sum, difference, product, and quotient of num1 and num2.
  3. Printed the results of these arithmetic operations.

File

Data Types and Operators

What I Learned

  • Working with different data types: numbers and booleans.
  • Using comparison and logical operators.

Exercises

  1. Declared a number variable and assigned it a value.
  2. Declared another number variable and assigned it a floating number.
  3. Performed addition, subtraction, multiplication, division, modulus, and exponentiation with these numbers.
  4. Compared two numbers using comparison operators and stored the results in boolean variables.
  5. Used logical operators (AND, OR, NOT) with boolean variables.
  6. Used assignment operators to modify a variable's value.

File

Conditional Statements and Loops

What I Learned

  • Using if-else statements and switch statements to handle different conditions.
  • Writing for loops to iterate over a range of numbers or array elements.

Exercises

  1. Checked the temperature and printed messages based on different temperature ranges using if-else statements and switch statements.
  2. Checked if a number is divisible by 2, 3, or both using if-else statements and switch statements.
  3. Printed numbers from 1 to 10 using a for loop.
  4. Printed all even numbers between 1 and 20 using a for loop.
  5. Calculated the sum of all numbers from 1 to 100 using a for loop.
  6. Printed each element of an array using a for loop.
  7. Found and printed the largest number in an array using a for loop.

File

While Loops

What I Learned

  • Using while loops for repeated execution based on a condition.

Exercises

  1. Printed numbers from 1 to 10 using a while loop.
  2. Printed all even numbers between 1 and 20 using a while loop.
  3. Calculated the sum of all numbers from 1 to 100 using a while loop.
  4. Printed all multiples of 5 less than 50 using a while loop.

File

Do While Loops

What I Learned

  • Using do-while loops for repeated execution, ensuring the loop runs at least once.

Exercises

  1. Printed numbers from 1 to 10 using a do-while loop.
  2. Calculated the sum of all numbers from 1 to 100 using a do-while loop.
  3. Prompted the user to enter a number greater than 10, continuing to ask until a valid number was entered.
  4. Created a simple guessing game where the user guesses a number between 1 and 10 until the correct number is guessed.

File

This bootcamp refresher has helped reinforce my understanding of fundamental JavaScript concepts and improved my coding skills.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages