Last active
July 3, 2023 23:54
-
-
Save phptuts/f1798c200bf62d6b8caa871871ba33e7 to your computer and use it in GitHub Desktop.
day-12-js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let colors = []; | |
colors.push('red'); | |
colors.push('green'); | |
colors.push('blue'); | |
colors.unshift('yellow'); | |
console.log(colors, 'colors'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const colors = ['red', 'green', 'blue', 'yellow', 'red']; | |
const noReds = colors.filter(c => c !== 'red'); | |
console.log(noReds, 'noReds'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const colors = ['red', 'green', 'blue', 'yellow', 'red']; | |
const color = colors.find(c => c === 'purple'); | |
console.log(color, 'color'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment