CodeNewbie Community 🌱

Cover image for 200+ JS Resources to master programming πŸ’₯  Cheat Sheet
DevLorenzo
DevLorenzo

Posted on

200+ JS Resources to master programming πŸ’₯ Cheat Sheet

Hello World! I felt bored after completing the Ultimate Cheat Sheet Compilation, so I just decided to create another one! The most complete javascript cheat sheet and resource compilation you can find online!

πŸ”– - Waaait, don't leave this page without bookmarking it!!


⚑ Giveaway ⚑
We are giving away any course you need on Udemy. Any price any course.
Steps to enter the giveaway
--> React to this post
--> Subscribe to our Newsletter <-- Very important

PS: It took me around 10 hours to complete the article - So please remember the like ❀️ and super like πŸ¦„

Table of content


For beginners

What is JS (Javascript)

JavaScript is a scripting or programming language that allows you to implement complex features on web pages β€” every time a web page does more than just sit there and display static information for you to look at β€” displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video jukeboxes, etc. β€” you can bet that JavaScript is probably involved. It is the third layer of the layer cake of standard web technologies. MDN
image

What it used for?

To put things simply, JavaScript is an object orient programming language designed to make web development easier and more attractive. In most cases, JavaScript is used to create responsive, interactive elements for web pages, enhancing the user experience. Things like menus, animations, video players, interactive maps, and even simple in-browser games can be created quickly and easily with JavaScript. JavaScript is one of the most popular programming languages in the world. BitDegree - What Is JavaScript Used For And Why You Should Learn It

Hello World In Javascript:

alert("Hello World") β€” Output data in an alert box in the browser window
confirm("Hello World") β€” Opens up a yes/no dialog and returns true/false depending on user click
console.log("Hello World") β€” Writes information to the browser console, good for debugging purposes
document.write("Hello World") β€” Write directly to the HTML document
prompt("Remember the like!") β€” Creates a dialogue for user input
Enter fullscreen mode Exit fullscreen mode

Resources to learn it:

Mozilla’s JavaScript Guide
JavaScript track on Codecademy: Interactive tutorials for beginners.
JavaScript for Cats by Max Ogden
Eloquent JavaScript by Marijn Haverbeke
Wikibooks’ JavaScript book
JavaScript Lectures by Douglas Crockford
You Don't Know JS - Possibly the best book written on modern JavaScript, completely readable online for free, or can be bought to support the author.
braziljs/js-the-right-way - An easy-to-read, quick reference for JS best practices, accepted coding standards, and links around the Web.
JSbooks - Directory of free JavaScript ebooks.
Superhero.js - A collection of resources about creating, testing and maintaining a large JavaScript code base.
SJSJ - Simplified JavaScript Jargon is a community-driven attempt at explaining the loads of buzzwords making the current JavaScript ecosystem in a few simple words.
How to Write an Open Source JavaScript Library - A comprehensive guide through a set of steps to publish a JavaScript open source library.
JavaScript Tutorials - Learn Javascript online from a diverse range of user ranked online tutorials.
Functional-Light JavaScript - Pragmatic, balanced FP in JavaScript.
Clean Code JavaScript - Clean Code concepts adapted for JavaScript.
List at GitHub - Awesome Javascript - By Alexandru Gherasim

At Reddit - What 10 Things Should a Serious Javascript Developer Know Right Now?

  • Scope. If you don't understand this intimately then you aren't that serious about this language. This is the number one point intentionally and I cannot stress it enough.

  • Architecture. You don't have to be a master software architect, but if you cannot perform some basic planning and put pieces together without massive layers of tooling you are an imposter. Expecting frameworks and other tools to simply do it for you isn't very impressive.

  • DOM. It is very common to see developers hiding from the DOM by layers of abstractions and other stupid crap. querySelectors are great, but are also 2800x slower than the standard DOM methods. That isn't trivial. These methods are super simple, so there is no valid excuse for developers fumbling over this or hiding in fear. http://prettydiff.com/guide/unrelated_dom.xhtml

  • Node.js If you are a serious developer should have a pretty solid grasp of how to walk the file system. You should understand how to conveniently read files as text or less conveniently read files as bit for bit binary buffers.

  • Timing and asynchronous operations. Events, timers, network requests are all asynchronous and separate from each other and exist both in Node and in the browser. You have to be able to understand how to work with callbacks or promises.

  • Accessibility. The interactions imposed by JavaScript can present accessibility barriers. A serious JavaScript developer is already familiar with WCAG 2.0 and knows how to work within its recommendations or when to push back on violating business requirements.

  • Security. You need to have at least a basic understanding of security violations, security controls, and privacy. You don't need to be a CISSP, but you need to be able to supply recommendations and avoid obvious failures. If you cannot get this right in the most basic sense you aren't a serious developer.

  • Data structures. You need to understand how to organize data in a way that allows the fastest possible execution without compromising maintenance. This is something that is learned through academic study and repeated experience writing applications.

  • Presentation and semantics. You really need to have a basic understanding how to properly organize the content your users will consume and how to present in a consumable way efficiently. This is something almost completely learned from experience only. You might think CSS and HTML are simple skills that can be picked up when needed, but you would be absolutely wrong.

  • Knowing when to avoid the bullshit. Many developers lack the years of experience to be confident in their performance.... so some of these developers will try to fake it. Don't be an imposter, because everybody will see straight through it. Hoping mountains of abstractions, tooling, frameworks, compilers, and other bullshit will save you just bogs down your application and screws over your teammates. If you aren't confident then be honest about that and seek mentorship or get involved with open source software outside of work.

image
Source

JS Cheat Sheet:

--> Download the PDF Version of this Cheat Sheet here

Include Javascript:

<script type="text/javascript"></script>

// or Include it in an external file (this is a comment)
/* This is also another way you can insert comments,
Multiline normally */

<script src="myscript.js"></script><code></code>

// PS: Remember to sub to our newsletter for the Giveaway!
Enter fullscreen mode Exit fullscreen mode

Variables:

var myVariable = 22; //this can be a string or number. var is globally defined

let myVariable = 22; //this can be a string or number. let can be reassigned

const myVariable = 22; //this can be a string or number. can't be reassigned
Enter fullscreen mode Exit fullscreen mode

JavaScript Variables - w3schools

Article - JS hide and show elements


Data Types:

//string
var string = 'ASCII text';
//int
var integer = 123456789;
//float
var float = 123.456;
//boolean, can be true or false
var t = true;
var f = false;
//undefined
var undef;//defaults to undefined
var undef = undefined;//not common, use null
//null
var nul = null;
//array
var arr = ['Hello','my','name','is','Dr.Hippo',123,null];
//object
var person = {'name':'John Smith','age':27};
//function
var fun = function(){
    return 42;
}
Enter fullscreen mode Exit fullscreen mode

image

Source - Datatypes In JavaScript - c-sharpcorner.com


Operators

Basic Operators

+ β€” Addition
- β€” Subtraction
* β€” Multiplication
/ β€” Division
(...) β€” Grouping operator, operations within brackets are executed earlier than those outside
% β€” Modulus (remainder )
++ β€” Increment numbers
-- β€” Decrement numbers
Enter fullscreen mode Exit fullscreen mode

Article - Js change text on hover

Comparison Operators

== Equal to
=== Equal value and equal type
!= Not equal
!== Not equal value or not equal type
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
? Ternary operator
Enter fullscreen mode Exit fullscreen mode

Logical Operators

&& Logical and
|| Logical or
! Logical not
Enter fullscreen mode Exit fullscreen mode

Bitwise Operators

& AND statement
| OR statement
~ NOT
^ XOR
<< Left shift
>> Right shift
>>> Zero fill right shift
Enter fullscreen mode Exit fullscreen mode

Loops

for - loops through a block of code a number of times.

for (statement 1; statement 2; statement 3) {
  // Coooode
}
Enter fullscreen mode Exit fullscreen mode

for/in - loops through the properties of an object.
for/of - loops through the values of an iterable object.

while - loops through a block of code while a specified condition is true.

var i=0;
while (i < 10) {
    console.log(i);
    i++;
}
Enter fullscreen mode Exit fullscreen mode

Break and Continue

When you use break without a label, it terminates the innermost enclosing while, do-while, for, or switch immediately and transfers control to the following statement.
When you use break with a label, it terminates the specified labeled statement.

When you use continue without a label, it terminates the current iteration of the innermost enclosing while, do-while, or for statement and continues execution of the loop with the next iteration. In contrast to the break statement, continue does not terminate the execution of the loop entirely. In a while loop, it jumps back to the condition. In a for loop, it jumps to the increment-expression.
When you use continue with a label, it applies to the looping statement identified with that label.

Source - Loops and iteration - MDN


Article - JS on scroll events

Strings

image
dev.to Article - 10 JavaScript string methods you should know - by @frugencefidel

Escape characters

\' β€” Single quote
\" β€” Double quote
\\ β€” Backslash
\b β€” Backspace
\f β€” Form feed
\n β€” New line
\r β€” Carriage return
\t β€” Horizontal tabulator
\v β€” Vertical tabulator
Enter fullscreen mode Exit fullscreen mode

Array and array methods

image
Top 10 JavaScript Array Methods You Should Know - By Rachel Cole at morioh.com

concat(arr1,[...]) // Joins two or more arrays, and returns a copy of the joined arrays
copyWithin(target,[start],[end]) // Copies array elements within the array, to and from specified positions
entries() // Returns a key/value pair Array Iteration Object
every(function(currentval,[index],[arr]),[thisVal]) // Checks if every element in an array pass a test
fill(val,[start],[end]) // Fill the elements in an array with a static value
filter(function(currentval,[index],[arr]),[thisVal]) // Creates a new array with every element in an array that pass a test
find(function(currentval,[index],[arr]),[thisVal]) // Returns the value of the first element in an array that pass a test
findIndex(function(currentval,[index],[arr]),[thisVal]) // Returns the index of the first element in an array that pass a test
forEach(function(currentval,[index],[arr]),[thisVal]) // Calls a function for each array element
from(obj,[mapFunc],[thisVal]) // Creates an array from an object
includes(element,[start]) // Check if an array contains the specified element
indexOf(element,[start]) // Search the array for an element and returns its position
isArray(obj) // Checks whether an object is an array
join([seperator]) // Joins all elements of an array into a string
keys() // Returns a Array Iteration Object, containing the keys of the original array
lastIndexOf(element,[start]) // Search the array for an element, starting at the end, and returns its position
map(function(currentval,[index],[arr]),[thisVal]) // Creates a new array with the result of calling a function for each array element
pop() // Removes the last element of an array, and returns that element
push(item1,[...]) // Adds new elements to the end of an array, and returns the new length
reduce(function(total,currentval,[index],[arr]),[initVal]) // Reduce the values of an array to a single value (going left-to-right)
reduceRight(function(total,currentval,[index],[arr]),[initVal]) // Reduce the values of an array to a single value (going right-to-left)
reverse() // Reverses the order of the elements in an array
shift() // Removes the first element of an array, and returns that element
slice([start],[end]) // Selects a part of an array, and returns the new array
some(function(currentval,[index],[arr]),[thisVal]) // Checks if any of the elements in an array pass a test
sort([compareFunc]) // Sorts the elements of an array
splice(index,[quantity],[item1,...]) // Adds/Removes elements from an array
toString() // Converts an array to a string, and returns the result
unshift(item1,...) // Adds new elements to the beginning of an array, and returns the new length
valueOf() // Returns the primitive value of an array
Enter fullscreen mode Exit fullscreen mode

Functions

Syntax

function name(parameter1, parameter2, parameter3) {
  // code to be executed
}
Enter fullscreen mode Exit fullscreen mode

Examples

function myFunction(p1, p2) {
  return p1 * p2;   // The function returns the product of p1 and p2
}

let x = myFunction(4, 3);   // Function is called, return value will end up in x

function myFunction(a, b) {
  return a * b;             // Function returns the product of a and b
}

// Convert Fahrenheit to Celsius:
function toCelsius(fahrenheit) {
  return (5/9) * (fahrenheit-32);
}
document.getElementById("demo").innerHTML = toCelsius(77);
Enter fullscreen mode Exit fullscreen mode

Source - JavaScript Functions - w3schools


Maths

Methods
carbon (1)

Article - How to understand math, awesome resource list!

Properties

E β€” Euler’s number
LN2 β€” The natural logarithm of 2
LN10 β€” Natural logarithm of 10
LOG2E β€” Base 2 logarithm of E
LOG10E β€” Base 10 logarithm of E
PI β€” The number PI
SQRT1_2 β€” Square root of 1/2
SQRT2 β€” The square root of 2
Enter fullscreen mode Exit fullscreen mode

Date

JS how to get current date - Extract:

Javascript date objects allow us to work with date and time. We can retrieve information for it by creating a date and assign and assigning it to a variable:

let d = new Date(); // We usually call it d or date
Enter fullscreen mode Exit fullscreen mode

Date object provide us a lot of different methods, the most used are year, month, day, hours, minutes, seconds, and milliseconds. Remember that you always have to precise the entire year (1950 and not only 50), that we always start with 0 (so, for example, December is the eleventh, a minute is composed of 59 seconds...) and that day is in a 24 hours format.

You can then retrieve from date a lot of differents info:

d.getDate() Returns the day of the month (from 1-31)
d.getDay()  Returns the day of the week (from 0-6)
d.getFullYear() Returns the year
d.getHours()    Returns the hour (from 0-23)
d.getMilliseconds() Returns the milliseconds (from 0-999)
d.getMinutes()  Returns the minutes (from 0-59)
d.getMonth()    Returns the month (from 0-11)
d.getSeconds()  Returns the seconds (from 0-59)
Enter fullscreen mode Exit fullscreen mode

We can also set things... Open the article to continue reading


Events

Mouse
onclick - The event occurs when the user clicks on an element
oncontextmenu - User right-clicks on an element to open a context menu
ondblclick - The user double-clicks on an element
onmousedown - User presses a mouse button over an element
onmouseenter - The pointer moves onto an element
onmouseleave - Pointer moves out of an element
onmousemove - The pointer is moving while it is over an element
onmouseover - When the pointer is moved onto an element or one of its children
onmouseout - User moves the mouse pointer out of an element or one of its children
onmouseup - The user releases a mouse button while over an element

Keyboard
onkeydown - When the user is pressing a key down
onkeypress - The moment the user starts pressing a key
onkeyup - The user releases a key

Frame
onabort - The loading of a media is aborted
onbeforeunload - Event occurs before the document is about to be unloaded
onerror - An error occurs while loading an external file
onhashchange - There have been changes to the anchor part of a URL
onload - When an object has loaded
onpagehide - The user navigates away from a webpage
onpageshow - When the user navigates to a webpage
onresize - The document view is resized
onscroll - An element’s scrollbar is being scrolled
onunload - Event occurs when a page has unloaded

Form
onblur - When an element loses focus
onchange - The content of a form element changes (for , and )
onfocus - An element gets focus
onfocusin - When an element is about to get focus
onfocusout - The element is about to lose focus
oninput - User input on an element
oninvalid - An element is invalid
onreset - A form is reset
onsearch - The user writes something in a search field (for )
onselect - The user selects some text (for and )
onsubmit - A form is submitted

Drag
ondrag - An element is dragged
ondragend - The user has finished dragging the element
ondragenter - The dragged element enters a drop target
ondragleave - A dragged element leaves the drop target
ondragover - The dragged element is on top of the drop target
ondragstart - User starts to drag an element
ondrop - Dragged element is dropped on the drop target

Clipboard
oncopy - User copies the content of an element
oncut - The user cuts an element’s content
onpaste - A user pastes content in an element

Media
onabort - Media loading is aborted
oncanplay - The browser can start playing media (e.g. a file has buffered enough)
oncanplaythrough - When browser can play through media without stopping
ondurationchange - The duration of the media changes
onended - The media has reached its end
onerror - Happens when an error occurs while loading an external file
onloadeddata - Media data is loaded
onloadedmetadata - Meta Metadata (like dimensions and duration) are loaded
onloadstart - Browser starts looking for specified media
onpause - Media is paused either by the user or automatically
onplay - The media has been started or is no longer paused
onplaying - Media is playing after having been paused or stopped for buffering
onprogress - Browser is in the process of downloading the media
onratechange - The playing speed of the media changes
onseeked - User is finished moving/skipping to a new position in the media
onseeking - The user starts moving/skipping
installed - The browser is trying to load the media but it is not available
onsuspend - Browser is intentionally not loading media
ontimeupdate - The playing position has changed (e.g. because of fast forward)
onvolumechange - Media volume has changed (including mute)
onwaiting - Media paused but expected to resume (for example, buffering)
animationend - A CSS animation is complete
animationiteration - CSS animation is repeated
animationstart - CSS animation has started

Other
transitionend - Fired when a CSS transition has completed
onmessage - A message is received through the event source
onoffline - Browser starts to work offline
ononline - The browser starts to work online
onpopstate - When the window’s history changes
onshow - A element is shown as a context menu
onstorage - A Web Storage area is updated
ontoggle - The user opens or closes the element
onwheel - Mouse wheel rolls up or down over an element
ontouchcancel - Screen touch is interrupted
ontouchend - User finger is removed from a touch screen
ontouchmove - A finger is dragged across the screen
ontouchstart - Finger is placed on touch screen


Asynchronous JS and Error handling

Article - JS set timeout and set interval - Extract:

SetTimeout will wait foo seconds and then execute the action. SetInterval will execute this same action every foo seconds.
Both can be inline or multiline, I recommend using multiline 99% of the time. It's important to notice that they work in milliseconds.

SetTimeout:

setTimeout(function(){
    alert("Hello World!"); 
}, 2000); // 2 seconds 

setTimeout(function(){ alert("The fifth episode of the series"); }, 3000);

SetInterval:

setInterval(function() {
  alert("I want to show you another Javascript trick:");
}, 1000); 

setInterval(function() {alert("How to work with SetTimeout and SetInterval");}, 1000); 
  • If you want to remove the first delay you have to add code a first time out of the function. I recommend you save this code in a separate function you can call whenever you need. Continue reading here

[Article - Js try/Catch]https://dev.to/devlorenzo/js-settimeout-and-setinterval-1pbf) - Extract:

First, it's important to notice that a majority of backend actions have an unknown result, we don't know if it will work when we write our code. So we always have to write two different codes, one if the action works, another if the action results in an error. This is exactly how a try/catch work, we submit a code to try, if it works code continues, if it doesn't we catch the error (avoiding the app crashing) and run another code. This is a very common thing we don't only use in web development (also in Android app development with java for example).

Try / Catch

  try {
  // Try to run this code 
 // For example make a request to the server
}
catch(e) {
  console.log(e)
  // if any error, Code throws the error
 // For example display an error message to the user
}

Promises

The big problem with try/catch is that when you have to nest it (and you will have), it's really messy and difficult to read and write. So Javascript support promises with async functions:

Syntax: new Promise (executor)
executor= (accept, reject) =>{}

var asyncronus_function = (number)=>
        {
            return new Promise( (accept, reject)=>
            {
            })
        } 

This function returns a promise object.
If function end well we return a accept(), otherwise reject()
More here

Back to Top - πŸ”


Projects ideas to become a javascript master

Article - 10 Projects to become a javascript master
a) General (for beginners)

  1. Converters
  2. Word Counter
  3. Timer / Clock
  4. Random password generator
  5. Calculator

b) Games

  1. Guess the number
  2. Math time!
  3. Other Games

c) Social & Websites

  1. Log-in, Sign-up
  2. Filter
  3. To-Do List
  4. Social
  5. Portfolio

Open the post for more info about each project!

Back to Top - πŸ”


Other resources:

Table of content

Complete JS cheat sheets:

image

By dev hints

image

Incredible resource --> By website setup

PDF Version

Two Others:
By overapi

By HTML cheat sheet.com - Interactive


JS promises (Asynchronous JS):

Dev.to article

[Article - JS how to handle errors]https://dev.to/devlorenzo/js-how-to-handle-errors-fi6 %}

Article - Js set timeout and set interval

image

By codecadamy


JS Arrays:

image

By dev hints


JS Loops:

image

By codecademy


JS preprocessor:

CoffeeScript:

CoffeeScript website

image

Others:
At karloeaspirity.io

Quick reference - By autotelicum - PDF Version

JS to CoffeeScript


EJS:

EJS website

EJS docs

image

At one compiler

Or at GitHub


Babel:

Babel website

Babel docs

image

By karloespiritu.io

Or at Medium


JavaScript-based Frameworks & Libraries:

Article Angular vs vue vs react at codeinwp.com

image

Best Javascript Frameworks - article at hackr.io

Angular

image

By angular.io

image

By dev hints


Vue

image

By vue mastery

image

By dev hints

Other - By marozed


React

image

By dev hints

Others:
By react cheat sheet.com

At GitHub: React + Typescript cheat sheet


JQuery

AJAX intro + cheat sheet at GitHub

image

By ascarotero.com - Really well done

image

By Website Setup - PDF Version

image

By make website hub

PDF Version

image

Article about top 10 jquery cheat sheets

Or by over API


Others

Ember.js:

image

Website

Meteor:

image

Website

Mithril:

image

Website

Node

image

Website


Other Resources:

Advanced Topics

  • How Browsers Work: Behind the scenes of modern web browsers
  • Learning Advanced JavaScript by John Resig
  • JavaScript Advanced Tutorial by HTML Dog
  • WebGL Fundamentals
  • Learning JavaScript Design Patterns by Addy Osmani
  • Intro to Computer Science in JavaScript
  • Immutable data structures for JavaScript

Libraries/Frameworks/Tools

  • Introduction to React video
  • React Interview Questions
  • JavaScript Promises: A Tutorial with Examples
  • Khan Academy: Making webpages interactive with jQuery
  • A Beginner’s Guide To Grunt: Build Tool for JavaScript
  • Getting Started with Underscore.js
  • jQuery Course by Code School
  • Thinkster.io Courses on React and Angular
  • The Languages And Frameworks You Should Learn In 2016
  • ES6 Tools List on GitHub
  • Getting Started with Redux

Server-side JavaScript

  • Real-time Web with Node.js Course by Code School
  • NodeSchool Course
  • Node.js First Look on Lynda
  • All about NodeJS Course on Udemy
  • Server-side Development with NodeJS Course on Coursera

Source (with links) - 50 resources to help you start learning JavaScript - By Daniel Borowski - At Medium

Thanks for reading and Happy coding ❀


Full Compilation of cheat sheets


⚑Giveaway ⚑

We are giving away any course you need on Udemy. Any price any course.
Steps to enter the giveaway
--> React to this post
--> Subscribe to our Newsletter <-- Very important
--> Follow me on Twitter <-- x2 Chances of winning

The winner will be announced on May 1, Via Twitter


Subscribe to my Newsletter!

  • The PDF version of this article!!!
  • Monday: Weekly digeeeeeests!!!
  • Wednesday: Discussions and dev insights - We debate around developer lifes - Examples: The importance of coffee behind development / If you weren't a dev, you'd be a...​
  • Gifts, lots of 🎁. We send cheat sheets, coding advice, productivity tips, and many more!
  • That's --> free <-- and you help me!

PS: It took me around 10 hours to complete the article - So please remember the like ❀️ and super like πŸ¦„ - Let's reach the top of the month this time πŸš€

Back to Top - πŸ”

Top comments (5)

Collapse
 
app3212 profile image
app3212

Creating a comprehensive list of 200+ JavaScript resources in a single response would be quite extensive, but I can certainly provide you with a curated list of some top resources to help you master JavaScript programming keziapickup lines.com/. These resources cover various aspects of JavaScript and can serve as a great starting point:

Collapse
 
jerr045 profile image
jerr045

Certainly! Here's a curated list of JavaScript resources that cover various aspects of programming, ranging branded products from beginner to advanced levels.

Collapse
 
asiasin profile image
AsiaSin

Great article) I think I'm using some information on the Cleveroad Blog

Collapse
 
devlorenz0 profile image
DevLorenzo

And a special thank goes to the @codenewbiestaff for building this awesome community!

Collapse
 
kvspbs profile image
Bhavya Sri K

Thanks, bro that was a great article for beginners to start with JavaScript 😁