-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlearning.js
More file actions
45 lines (36 loc) · 985 Bytes
/
Copy pathlearning.js
File metadata and controls
45 lines (36 loc) · 985 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
40
41
42
43
// Variable declarations
var studlyCapVar;
var properCamelCase;
var titleCaseOver;
// Variable assignments
studlyCapVar = 10;
properCamelCase = "A String";
titleCaseOver = 9000;
//Example of const and let
const FCC = "freeCodeCamp";
let fact = "is cool!";
fact = "is awesome!";
console.log(FCC, fact);
//Arthimetic operators
const quotient=45/12
const product=45*2
const sum=2+2
const difference=2-1
//% is remainder 5%2=1
//i++ is the same as i=i+1
//i-- is the same as i=i-1
console.log(sum)
//strings are like the same in python
const myStr= "This is a string"
const alsoStr='This is also a string'
//<a a> is like a new way to hold big strings and then the >link</a>' is a bit confusing
const newStrtype='<a"new string type href="http://whatever.com"target="black">link</a>'
//escape sequences in strings
// \' = single quote
// \" = double quote
// \\ = backslash
// \n = newline
// \t = tab
// \r = carriage return
// \b = backspace
// \f = form feed