Computer Science, asked by barshapodder2499, 3 months ago

var numbers = [1,2,3,4,5,6,7,8,9,10] ; var colours = ["red", "orange", "yellow", "green"] ; numbers.forEach(function(color) { if (color% 3 === 0) { console.log(color); } } ) ; what will be output?​

Answers

Answered by Oreki
4

\text{\large\bf Given Snippet}

   \texttt{var numbers = [1,2,3,4,5,6,7,8,9,10]}\\\texttt{colours = ["red", "orange", "yellow", "green"] }\\\texttt{numbers.forEach(function(color) \{}\\\texttt{\hspace{2em} if (color \% 3 === 0) \{}\\\texttt{\hspace{4em} console.log(color)}\\\texttt{\hspace{2em} \}}\\\texttt{\: \})}

\text{\large\bf \symbol{79}utput}

   \texttt{3}\\\texttt{6}\\\texttt{9}

Similar questions