-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathscript.js
More file actions
67 lines (48 loc) · 1.99 KB
/
script.js
File metadata and controls
67 lines (48 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//#1
//Declare a variable called 'name' that has the value of your name.
/*code here*/
//#2
//create an if statement that checks to see if your name is equal to 'Ben'
//If yes, log 'yes'
//otherwise log 'no'
//note: use console.log to log the string
/*code here*/
//#3
//create an array called 'favoriteFoods'.
//fill it up with the names of several of your favorite foods
/*code here*/
//#4
//use a for loop to log each food in the 'favoriteFoods' array
/*code here*/
//#5
//create an object called 'favoriteMovie'.
//give 'favoriteMovie' a property called 'runtime' and set it equal to how long the movie is in minutes
//give 'favoriteMovie' a property called 'title' and set it equal to the title
//give 'favoriteMovie' a property called 'director' and set it equal to the director's name
/*code here*/
//#6
//create a function called 'sayHi'.
//'sayHi' should accept one argument called 'name'
//when 'sayHi' is invoked it should log the string 'Hello <name>!' where <name> is equal to the 'name' argument
/*code here*/
//#7
//create an array called 'friends'
//create three objects that have information about your friends
//each object should have a 'name', 'age', and 'vocation' property with appropriate data
//put the three objects inside of the 'friends' array
/*code here*/
//#8
//use a for loop to iterate over the 'friends' array from problem #7
//inside the for loop print the string 'My friend <name> is <age> years old and does <vocation> for work.'
/*code here*/
//#9
//create a constructor called 'User' that can function as a class for creating new user objects
//'User' should take 'email', and 'password' as arguments
//each instance of 'User' that is created should have a 'email', and 'password' property that is equal to the arguments passed to the constructor
/*code here*/
//#10
//create a function called 'nFactorial(num)'
//'nFactorial' should return the factorial of the 'num' argument
//note: the factorial of 5 is (5 * 4 * 3 * 2 * 1) -> 120
//try to solve this recursively
/*code here*/