Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

js-practice

//Questions

  1. The "Greeting Machine" Write a function sayHello(n) that prints "Hello!" n times to the console.

  2. The "Total Sum" Write a function sumUpTo(max) that adds all numbers from 1 to max and returns the result.

  3. The "Array Lister" Write a function printList(arr) that takes an array of names and prints each one individually.

  4. The "Even Only" Write a function onlyEvens() that loops from 1 to 20 and only prints the numbers that are even.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder 5. The "Reverse Countdown" Write a function blastOff(start) that counts down from the start number to 0.

  1. The "Star Builder" Write a function drawStars(n) that returns a single string containing n stars (*).

  2. The "Skip a Number" Write a function skipFive() that prints numbers 1 through 10, but uses an if statement to not print the number 5.

  3. The "Double It" Write a function doubleArray(arr) that takes an array of numbers and prints each number multiplied by 2.

  4. The "Find the Target" Write a function findCheck(arr, target) that loops through an array. If it finds the target string, it prints "Found it!".

  5. The "Square Numbers" Write a function printSquares(n) that prints the square of every number from 1 up to n.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages