Skip to content

Commit 14e2179

Browse files
author
Tanya Butenko
authored
Update cheat-sheet.md
1 parent 367a59a commit 14e2179

File tree

1 file changed

+48
-24
lines changed

1 file changed

+48
-24
lines changed

cheat-sheet.md

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,120 @@
11
# JavaScript Cheatsheet
22

33

4-
**JavaScript (or JS)**
4+
###JavaScript (or JS)
5+
56
It is a popular programming language commonly used to create interactive effects within web browsers
67

78

8-
**variable**
9+
###variable
10+
911
A place to store values, can store any kind of information(data types): numbers, words, collections of data
1012

1113

12-
**undefined variable**
14+
###undefined variable
15+
1316
A variable that has no value
1417

15-
**to declare variable**
18+
###to declare variable
19+
1620
To create a variable - done by using ‘ var variable-name = value ’
1721

1822

19-
**to initialize variable**
23+
###to initialize variable
24+
2025
Set (give) some value to variable.
2126

22-
**string**
27+
###string
28+
2329
A set of characters, word, phrase. To initialize variable with a string you need to put this string into quotes.
2430

25-
**boolean**
31+
###boolean
32+
2633
Boolean variable represent a logical values True or False
2734

2835

29-
**array**
36+
###array
37+
3038
An ordered list of values, can store different type of data inside
3139

3240

33-
**operator**
41+
###operator
42+
3443
Mathematical operators, such as: +, -, *, /, >, <, = etc
3544

3645

37-
**comments**
46+
###comments
47+
3848
Comments are some notes that you can leave for yourself or another person, the note that computer will not read. You can write a comment on a new line or on the same line after code as so: //I’m your comment
3949
Single line comment starts with //
4050
Multi line comment are placed between /* .. */
4151

4252

43-
**function**
53+
###function
54+
4455
A separable, reusable piece of code. It takes some input do some manipulation on it and return us output
4556

4657

47-
**to declare function**
58+
###to declare function
59+
4860
To create a function
4961

50-
**argument**
62+
###argument
63+
5164
A value input that functions can accept
5265

5366

54-
**if/else statement**
67+
###if/else statement
68+
5569
‘If’ used to decide which lines of code to execute, ‘else’ - to give alternative set of instructions. Example: if(x > 5) {console.log”X bigger than 5”}; else {console.log”X smaller than 5”};
5670

5771

58-
**while loop**
72+
###while loop
73+
5974
It repeats code over and over again until some condition is met
6075

6176

62-
**for loop**
77+
###for loop
78+
6379
This loop is similar to ‘while loop’, just with set amount of repetition. You declare counter in the statement as so: for(var i = 0; i < 5; i++){do something 5 times};
6480

6581

66-
**infinite loop**
82+
###infinite loop
83+
6784
A loop that does not stop and it’s a loop that you need to avoid. Each loop should have some condition so it can stop.
6885

6986

70-
**object**
87+
###object
88+
7189
A collection of properties
7290

7391

74-
**event**
92+
###event
93+
7594
A type of object that is created when user interacts with web page. For example, JavaScript creates an event when user clicks on a button.
7695

7796

78-
**CSS**
97+
###CSS
98+
7999
Stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen. It is presentation.
80100

81101

82-
**HTML**
102+
###HTML
103+
83104
Stands for Hyper Text Markup Language. It is a structure of the elements on the page.
84105

85106

86-
**DOM**
107+
###DOM
108+
87109
Stands for Document Object Model. It defines the logical structure of documents and the way a document is accessed and manipulated.
88110

89111

90-
**scope**
112+
###scope
113+
91114
Scope is the set of variables, objects, and functions that you can access
92115

93116

94-
**console**
117+
###console
118+
95119
A method of interacting with the system. In order to write to the browser console, you could use console.log(‘Hello World’). This would write Hello World in the browser console.
96120

0 commit comments

Comments
 (0)