Skip to content

Latest commit

 

History

History
15 lines (6 loc) · 1.01 KB

TASKS.md

File metadata and controls

15 lines (6 loc) · 1.01 KB

Javascript Tasks

  1. Print all even numbers from 0 – 10 - Try to make the solution to this problem as efficiently as possible. Consider using loops that would allow you to type the fewest characters/commands. While you could simply print the even numbers, get creative and see how you could output them in a way that would work up to 10 or even up to 10,000 with little extra effort.

  2. Create a length converter function - handles conversion from kilometers to miles. The function should include the input in kilometers and return the answer in miles. 1.60 km = 1 mile

  3. Calculate the sum of numbers within an array - Create a function that Takes an array of numbers e.g. [1, 2, 3, 4, 5, 6] and returns a sum of all numbers

  4. Create a function that filters out negative numbers - Create a function that takes an array as an input and returns an array with all the negative numbers removed

  5. Remove the spaces found in a string - create a function that takes a string and returns a string with all the spaces removed.