Skip to content

Dimah-Aldossari/W02D01-HW-Array-Conditions

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

JavaScript conditions and loops HWs

For loop

Numbers' summations

  • Loop though this array let Numbers = [23,54,32,87,47] and print the sum of all numbers

Maximum number

  • Create an array of the following numbers [16,4,2,0,19,6]
  • Loop through the array elements and print the maximum number of this list to the console.

Reverse Array

  • Create an array of the following numbers [1,2,3,4,5,6,7,8,9,10]
  • print the array in a reverse order

Nested for loop

stars pattern

  • Declare a variable and assign a number to it.
  • Print a right angle triangle using stars to the console. Example: if the variable is 5, the printed pattern will be as follow:

*
**
***
****
*****

While loop

  • Create an array of the following numbers [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]
  • Loop through this array and print the prime numbers.

Note: A number is prime if it is divided by 1 and itself only.

Arrays

MAP

  1. Get array of objects with just name and height properties
  2. Get array of all first names

REDUCE

  1. Get total mass of all characters
  2. Get total number of characters in all the character names

FILTER

  1. Get characters with mass greater than 100
  2. Get all female characters

SORT

  1. Sort by name
  2. Sort by gender

EVERY

  1. Does every character have blue eyes?
  2. Is every character male?

SOME

  1. Is there at least one male character?
  2. Is there at least one character that has mass less than 50?

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%