@jZero/

WoozyFloralwhiteAssignments

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*function return_only_10_plus(){
    let initial_array = [1, 21, 5, 6, 42, 8, 3, 10, 15]

    //Populate the final array only with numbers greated than 10
    let final_array = []
    initial_array.forEach( function(item){ 
	if(item >10) {
		final_array.push(item)
	}})
    return final_array
    
}

return_only_10_plus()*/

function return_only_10_plus(){
    let initial_array = [1, 21, 5, 6, 42, 8, 3, 10, 15]

    //Populate the final array only with numbers greated than 10
    let final_array = []
    initial_array.forEach( (item)=>{if(item > 10){final_array.push(item)}})
    return final_array
    
}

return_only_10_plus()
node v10.16.0