Created
May 19, 2023 00:15
-
-
Save MichaelCharles/b069877ca49828832c4056f8e9042c03 to your computer and use it in GitHub Desktop.
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 students = [ | |
| {name: '太郎', age: 15}, | |
| {name: '花子', age: 14}, | |
| {name: '次郎', age: 16}, | |
| ]; | |
| let agedStudents = students.map(function(student) { | |
| return {name: student.name, age: student.age + 1}; | |
| }); | |
| console.log(agedStudents); | |
| // [{name: '太郎', age: 16}, {name: '花子', age: 15}, {name: '次郎', age: 17}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment