Skip to content

Markdown formatting #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,17 @@

An introductory JavaScript workshop for beginners.

##Slides
## Slides

Check on slides, click [here](https://slides.com/tanyabutenko/ngs-intro/)


##Feedback
## Feedback

To leave feedback click [here](https://goo.gl/forms/MxDr9q2A4PQV4CRI3)


##How to use
_______________


## How to use

If you are familiar with git, you can clone this repository to your machine and simply start working
through files starting from README.md file, after that jump to js/level1.js file.
Expand All @@ -33,9 +30,7 @@ Follow the instructions in _level1.js_ file and type code in your Text Editor (i



##Structure
____________________

## Structure

- CSS folder - contains css files that are responsible for styles and how our project looks on the web.

Expand Down
88 changes: 58 additions & 30 deletions cheat-sheet.md
Original file line number Diff line number Diff line change
@@ -1,119 +1,147 @@
# JavaScript Cheatsheet


###JavaScript (or JS)
## JavaScript (or JS)

It is a popular programming language commonly used to create interactive effects within web browsers.


###variable
## variable

A place to store values, can store any kind of information (data types): numbers, words, collections of data


###undefined variable
### undefined variable

A variable that has no value

###to declare variable
### to declare variable

To create a variable - done by using ‘ var variable-name = value ’
To create a variable - done by using:

```
var variableName = value;
```

###to initialize variable

### to initialize variable

Set (give) some value to variable.

###string
## value types

### string

A set of characters, word(s), phrase. To initialize variable with a string you need to put this string into quotes.

###boolean
### boolean

Boolean variable represent a logical value True or False


###array
### array

An ordered list of values, can store different types of data inside


###operator
### operator

Mathematical operators, such as: +, -, *, /, >, <, = etc


###comments
## comments

Comments are some notes that you can leave for yourself or another person, a note that a computer will not read. You can write a comment on a new line or on the same line after code as so:

Comments are some notes that you can leave for yourself or another person, a note that a 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
Single line comment starts with //
Multi line comment are placed between /* .. */
```
// I’m your comment
```
Single line comment starts with `//`
Multi line comment are placed between `/* .. */`


###function
## function

A separable, reusable piece of code. It takes some input, does some manipulation on it and returns us an output.


###to declare function
### to declare function

To create a function

###argument
### argument

A value input that functions can accept


###if/else statement
## if/else statement

‘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”};
`if` used to decide which lines of code to execute, `else` - to give alternative set of instructions.

Example:

###while loop
```
if (x > 5) {
console.log("X bigger than 5");
}
else {
console.log("X smaller than 5");
}
```

## Iterating/Loops

### while loop

It repeats code over and over again until some condition is met.


###for loop
### for loop

This loop is similar to ‘while loop’, just with a set amount of repetition. You declare counter in the statement as so:

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


###infinite loop
### infinite loop

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.


###object
## object

A collection of properties


###event
## event

A type of object that is created when a user interacts with a web page. For example, JavaScript creates an event when a user clicks on a button.


###CSS
## CSS

Stands for Cascading Style Sheets. CSS describes how HTML elements are to be displayed on screen. It is presentation.


###HTML
## HTML

Stands for Hyper Text Markup Language. It is a structure of the elements on the page.


###DOM
## DOM

Stands for Document Object Model. It defines the logical structure of documents and the way a document is accessed and manipulated.


###scope
## scope

Scope is the set of variables, objects, and functions that you can access.


###console
## console

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.