Cheatography
https://cheatography.com
A cheat sheet about the base of the programming language JS
Language itself
Language for web 98% site use it create dynamic and interactive web content like applications and browsers
JS is an interpreted language, it's a dynamic typing language and a weakly typed language.
As JS use a form of automatic memory management it's garbage collected.
JS is both an oriented object language and a functional language, the particularity of it's OOP is in inheritance which is very complete and easy to use. |
Language environment
To execute JavaScript in a browser you have two options either put it inside a script element anywhere inside an HTML document, or put it inside an external JavaScript file (with a . js extension).
To run JS you only need a text editor and a web browser where you can execute it by implementing it in an html code, this means it's a multiplatform language whiwh can be used on all the OS and does not have any impact on your local machine.
If you want to run it in a terminal you need node.js. |
Library
jQuery |
It makes things simpler for HTML document manipulation and traversal, animation, event handling, and Ajax. |
React.js |
Just design a simple view for individual states in your app. Next, it will render and update the right component efficiently upon data changes. |
D3.js |
Document manipulation based on data. |
Lodash |
JS utility library that makes it easier to work with numbers, arrays, strings, objects, etc. |
Algolia Places |
JavaScript library that provides an easy and distributed way of using address auto-completion on your site. It’s a blazingly fast and wonderfully accurate tool that can help increase your site user experience. |
To go further
The philosophy behind the creation of JS is simplicity, composability, uniformity as the only programming language native to the web browser.
JS is used for :
- Adding interactive behavior to web pages
- Creating web and mobile apps
- Building web servers and developing server applications
- Game development (in browser) |
|
|
Syntax and data structures
|
print into the terminal |
|
create a mutable variable |
|
create an immutable variable |
|
concatenate if both string else if both numerical sum |
|
if printed show the value of the variable |
if (condition){Do something}; else if (){}; else {}
|
condition |
for (var i = 0; i <= 11; i++){ Do something; }
|
for loop |
while (condition){ Do something; }
|
while loop |
|
create an array |
|
append the array |
const readline = require('readline').createInterface({ input: process.stdin, output: process.stdout }); readline.question("text", (var) => { Do something ; readline.close(); })
|
to print text and take the answer from the terminal as a variable |
class ClassName { constructor(var){this.var;} Method(){}}
|
create a class |
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by Todin