-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBasic.js
More file actions
36 lines (30 loc) · 675 Bytes
/
Basic.js
File metadata and controls
36 lines (30 loc) · 675 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
//# ON PAGE SCRIPT
<script type="text/javascript"></script>;
//# INCLUDE EXTERNAL JS FILE
<script src="index.js"></script>;
//# FUNCTION
function myFunction() {
return a + b;
}
//# COMMENTS
/* Multi line */
// One line
//# BORDER WIDTH
console.log(a);
document.write(a);
alert(a);
confirm("Realy");
prompt("Your age?", "0");
//# Data Types
var age = 18; // number
var name = "therogersak"; // string
var person = { name: "therogersak", age: 18 }; // object
var sheets = ["HTML", "CSS", "JAVASCRIPT"]; // array
var a = undefined; // undefined
var b = null; // null
//# IF-ELSE STATEMENT
if (age > 18) {
console.log("Nice");
} else {
console.log("Not Eligible");
}