Write a JavaScript code to reverse the array colors without using the reverse method
.
Input:
const colors = ['red', 'blue', 'green', 'yellow', 'orange']
Output:
['orange', 'yellow', 'green', 'blue', 'red']
Write a JavaScript code to get the even numbers from an array using any looping technique.
Input:
const numbers = [12, 98, 5, 41, 23, 78, 46];
Output:
[12, 98, 76, 46]
Use a for...of loop to concatenate all the elements of an array into a single string.
Input:
var numbers = ['Tom', 'Tim', 'Tin', 'Tik']
Output:
'TomTimTinTik'
Reverse the words of a sentence. Only the position of the word will be reversed. check out the output
Input:
const statement = 'I am a hard working person'
Output:
'person working hard a am I'