-
Notifications
You must be signed in to change notification settings - Fork 4k
Expand file tree
/
Copy pathscript.js
More file actions
executable file
·39 lines (28 loc) · 986 Bytes
/
script.js
File metadata and controls
executable file
·39 lines (28 loc) · 986 Bytes
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
/**
* Scope and the var statement
* @link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var
*/
// var color = "bluesky";
// document.querySelector(".left").style.backgroundColor = color;
// document.querySelector(".left .color-value").innerHTML = color;
// color = "bluesky";
// document.querySelector(".right").style.backgroundColor = color;
// document.querySelector(".right .color-value").innerHTML = color;
// -----
// function headingColor() {
// color = "blue";
// document.querySelector(".title").style.color = color;
// }
// headingColor();
// let a = 10;
// let b = 5;
// let c = 3.7;
// console.log(`let a: ${a} , typeof ${typeof a}`);
// console.log(`let b: ${b} , typeof ${typeof b}`);
// console.log(`let c: ${c} , typeof ${typeof c}`);
// let result = a - c;
// console.log(`result : ${result}`);
const factorial = function fac(n) {
return n < 2 ? 1 : n * fac(n - 1);
};
console.log(`factorial result: ${factorial(4)}`);