-
Notifications
You must be signed in to change notification settings - Fork 76
Expand file tree
/
Copy pathmethods.js
More file actions
49 lines (33 loc) · 1.48 KB
/
methods.js
File metadata and controls
49 lines (33 loc) · 1.48 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
// **** Example: sayHello() ****
// Write a function expression that returns "Hello " along with whatever string is
// passed in as an argument.
let sayHello = function(str) {
return `Hello ${str}`;
}
// Test your function at least three times below
console.log("Example Tests:");
console.log(sayHello("World"));
console.log(sayHello("Yarency"));
console.log(sayHello("Luis"));
// **** Problem 1: getQuotient() ****
// Write a function expression that returns the quotient of the first argument
// divided by the second.
// Test your function at least three times below
console.log("Problem 1 Tests:");
// **** Problem 2: sumDouble() ****
// Write a function expression that, when given two number values, return their
// sum. Unless the two values are the same, then return double their sum.
// Test your function at least three times below
console.log("Problem 2 Tests:");
// **** Problem 3: makes10() ****
// Write a function expression that, when govem 2 numbers, a and b, returns true
// if one if them is 10 or if their sum is 10.
// Test your function at least three times below
console.log("Problem 3 Tests:");
// **** Problem 4: Object Methods ****
// Write code that represents any object you like. Your object should have at
// least four properties and four methods. At least two of your methods should
// utilize the "this" keyword to refer to properties, or call other methods,
// owned by the object.
// Test all of your object's methods below.
console.log("Problem 4 Tests:");