Skip to content

Commit 59bfcc9

Browse files
new file has been added here
1 parent e54dd2d commit 59bfcc9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

E. Array-Loop/reverse.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/** Write a JavaScript code to reverse the array colors without using the reverse method.
2+
3+
Input: const colors = ['red', 'blue', 'green', 'yellow', 'orange']
4+
5+
Output:
6+
['orange', 'yellow', 'green', 'blue', 'red'] **/
7+
8+
let colors = ['red', 'blue', 'green', 'yellow', 'orange'];
9+
console.log(colors.reverse);

0 commit comments

Comments
 (0)