Skip to content
This repository was archived by the owner on Oct 26, 2020. It is now read-only.

Commit 12cf27e

Browse files
committed
comp
1 parent fd08653 commit 12cf27e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

week-3/1-exercises/A-array-find/exercise.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,19 @@
44
*/
55

66
// write your code here
7+
function findLongNameThatStartsWithA(names){
8+
let output=names.find(function(name){
9+
return name.charAt(0)==='A' && name.length>7;
10+
})
11+
return output;
12+
}
713

814
var names = ["Rakesh", "Antonio", "Alexandra", "Andronicus", "Annam", "Mikey", "Anastasia", "Karim", "Ahmed"];
915

1016
var longNameThatStartsWithA = findLongNameThatStartsWithA(names);
1117

1218
console.log(longNameThatStartsWithA);
1319

14-
1520
/* EXPECTED OUTPUT */
1621
// "Alexandra"
1722

0 commit comments

Comments
 (0)