Visitar URL original
Solved #2 Array.prototype.map() · Laryl14/JavaScript30@e51a0da · GitHub
Skip to content

Commit e51a0da

Browse files
author
laryl.li
committed
Solved wesbos#2 Array.prototype.map()
1 parent 107d261 commit e51a0da

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎04 - Array Cardio Day 1/index-START.html‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,17 @@
3434

3535
const born = inventors.filter(x => x.year >=1500 && x.year < 1600);
3636
console.log(born);
37-
37+
3838
// Array.prototype.map()
3939
// 2. Give us an array of the inventors first and last names
40+
const finalnamestring = inventors.map(firstandlastname)
41+
function firstandlastname (x){
42+
const space = ' '
43+
const namestring = x.first + space + x.last;
44+
return namestring;
45+
//console.log(namestring);
46+
}
47+
console.log(finalnamestring);
4048

4149
// Array.prototype.sort()
4250
// 3. Sort the inventors by birthdate, oldest to youngest

0 commit comments

Comments
 (0)