-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtinkering.js
69 lines (46 loc) · 1.36 KB
/
tinkering.js
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
68
69
/*function multiply(a, b) {
return a * b;
}
const result = multiply(2, 4);
console.log(result);*/
//Converting Temperature
/*var celcius = 12;
var farenheit = (celcius * 1.8) + 32;
console.log(farenheit);*/
//console.log("Up up\n\tDown down");
/*// Pick a string. Your string can have any number of characters.
var my_string = "a";
// Calculate the ASCII value of the first character, i.e. the character at the position 0.
var ASCII_value = my_string.charCodeAt(0);
// Let us print
console.log(ASCII_value);*/
//Check null and undefined
/*var signedIn;
console.log(signedIn);
var signedIn = null;
console.log(signedIn);*/
//Quiz quest in Udacity.com
/*var thingOne = "red";
var thingTwo = "blue";
//
var bill = 10.25 + 3.99 + 7.15;
var tip = bill * 0.15;
var total = bill + tip;
console.log(total.toFixed(2));
console.log(thingOne + thingTwo);*/
/*const amounts = [61.00, 52.25, 112.99, 5.00];
var total = 0;
/*for (let i = 0; i < amounts.length; i++) {
total += amounts[i];
}
console.log("Order total is " + total);*/
/*for (let amount of amounts) {
total += amount;
}
console.log("Order total is " + total);*/
//var turnMeIntoAString = ["U", "d", "a", "c", "i", "t", "y"];
//console.log(turnMeIntoAString.join(''));
words = ["cat", "in", "hat"];
words.forEach(function (word, num, all) {
console.log("Word " + num + " in " + all.toString() + " is " + word);
});