forked from SoftStackFactory/fix-errors
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlesson9.js
More file actions
23 lines (21 loc) · 650 Bytes
/
lesson9.js
File metadata and controls
23 lines (21 loc) · 650 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*Desired result Print out all names except the name passed into the function
######NOTE#######
let is just another way to assign a variable like var except
it is locally scoped to the function. Var would assign our variable Globally in
our code.
*/
var people = [
{ name: "John", age: 55 },
{ name: "Roger", age: 44 },
{ name: "Betty", age: 37 }
]
var nameFilter = function(name) {
let name = "Eric"
for (let i = 0; i < people.length; i++) {
let name = people[i].name
if (name != filteredName) {
console.log("My Name is " + name)
}
}
}
nameFilter("Roger")