Created
June 17, 2023 22:40
-
-
Save kironroy/35ce6dce1f043facfd2eda939e956864 to your computer and use it in GitHub Desktop.
find method
This file contains 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 movements2 = [200, 450, -400, 3000, -650, -130, 70, 1300]; | |
const firstWithdrawal = movements2.find(mov => mov < 0); | |
console.log(movements2); | |
console.log(firstWithdrawal); | |
// array of objects is a common data structure | |
console.log(accounts); | |
const account = accounts.find(acc => acc.owner === 'Jessica Davis'); | |
console.log(account); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment