Javascript Operators Cheat Sheet

broken image


Some people say- 'Not learning JavaScript means you are not a serious developer'. But learning the whole JavaScript is really tough. So, an easy way to have frequent things handy, we have JavaScript Cheat Sheet!!

Operators 5 Functions 6 JavaScript Loop 7 If - Else Statements 8 Strings 8 Regular Expression Syntax 9 Numbers and Math 11. Online Interactive JavaScript (JS) Cheat Sheet. JavaScript Cheat Seet contains useful code examples on a single page. This is not just a PDF page, it's interactive! Find code for JS loops, variables, objects, data types, strings, events and many other categories. Popy-paste the code you need or just quickly check the JS syntax for your projects. Title: JavaScript date: 2020-12-24 17:12:25 icon: icon-javascript background: bg-yellow-500 tags: js categories: Programming intro: A JavaScript cheat sheet with the most important concepts, functions, methods, and more. A complete quick reference for beginners. Introduction to Boolean Operators in JavaScript Java script is a frontend development Language that has been used in websites for long. While there are several back end languages from programmers to choose from, there has been no alternative language developed as a replacement of Java script.

JavaScript is a very popular client-side scripting language. It is adopted universally for supporting dynamic content in a webpage. JavaScript makes a site more interactive & brings special effects to it. It is also applicable to external applications like PDF, widgets etc. If you are a web developer, you also need JavaScript. We have devised a list of top JavaScript cheat sheets. You can keep this list by your side when working on any JavaScript project as a great resource. Here at TemplateToaster web design software, I have listed the best JavaScript cheat sheets.

JavaScript Cheat Sheet

JavaScript cheat sheets will work as memory refreshing tools while developing a website. A JavaScript cheat sheet provides simple, brief instructions for executing JavaScript on a web page. It will help you to get started with JavaScript and let you know what all the things you can do with it. Here at Templatetoaster website builder, Let's explore some of the best JavaScript cheat sheets listed below

1. Cheatography Cheat Sheet

This JavaScript Cheat sheet is formulated by Dave Child. It enlists all the JavaScript methods and functions under different categories. All the categories are well-chosen and maintained to display the JavaScript syntax. The major categories are Regular Expression syntax, Pattern Modifiers, JavaScript Arrays, Event Handlers, Strings etc. It incorporates all the methods for string, date, number and math operations, to manage the events and much more. It also includes JavaScript Regular Exp Objects and functions.

Javascript operators cheat sheet

2. OverAPI Cheat Sheet

It is a comprehensive JavaScript Cheat sheet from the OverAPI collection of cheat sheets. Not only it groups the hole JavaScript syntax at one place but also redirects you to new links for the further details. It means whenever you click a specific element, it opens a new page that contains its syntax, short summary, and description with an example. Covers all the basic functions plus Graphics Methods and DOM properties. It is a great JavaScript resource as holds everything you need to know about it.

MediaTek's Helio G90 Series combines the latest Arm Cortex-A76 & Cortex-A55 CPUs in an octa-core combination. With a large L3 cache and speeds of up to 2.05GHz, it noticeably boosts speeds in demanding games and apps. Mtk g90. The MTK Helio G90 can support up to 48MP single camera or Dual 24MP+16MP for both back and front side. It comes with up 1080 x 2520 pixels Full HD+ display and up to10GB LPDDR4X RAM support. All the essential connectivity features are available such as Bluetooth 5.0, Dual VoLTE voice calling, GPS, dual-band Wi-Fi 5 (a/b/g/n/ac), NFC and FM Radio.

3. FirstSiteGuide Cheat Sheet

You can get a fancy JavaScript Cheat Sheet on FirstSiteGuide. It is a good exposure to JavaScript syntax for beginners. Gives you a brief overview of JavaScript variables, commands, functions, and methods under different categories. This colorful JavaScript collaboration is easy to refer and follow.

4. DOM JavaScript Cheat Sheet (PDF)

This cheat sheet is assembled by Christian Heilmann. It is a collection of the most commonly used DOM methods in JavaScript. It is really useful to locate an element, for navigating between nodes, reading element attributes and node values etc. Even, you can create new nodes.

5. JavaScript Regex Cheatsheet

In JavaScript, regular expressions are objects to match character combinations in strings. These are used with different methods of a string. So, this JavaScript Regex cheat sheet covers all the regex basics, quantifiers, classes to Regex replacement. It also includes Regex groups, assertions, and Regex flags. In whole, it is good quick reference to all the concepts associated with JavaScript Regular expressions.

6. JavaScript (ES6 and Beyond) Cheat Sheet

This JavaScript Cheat Sheet refers to the latest standard specification ES6 of JavaScript. ECMAScript (ES6) is a new JavaScript implementation. It focuses that how to create a scripting language. This cheat sheet displays the ES6 features of JavaScript. It represents ES6 variable, constants, Binary, Hex, and Octal notation, Arrow, and new scoped functions and much more. It is one of the best resources to get aware of new ES6 elements and concepts.

7. React.js Cheat Sheet

This cheat sheet represents a JavaScript library for creating user interfaces. It has a number of sections to target React v15 to v16. It covers the basic components, defaults, lifecycle, DOM nodes, JSX patterns, property validation etc. Each section divides into relevant sets of operation. Rollbar sponsors this cheat sheet. Rollbar is responsible for real-time error monitoring, analytics & altering for developers.

8. Interactive JavaScript Cheat Sheet

This JavaScript Cheat Sheet summarizes the all useful elements on a single page. It marks the code example for every element included. Contains different sections for loops, variables, arrays, strings, events, numbers, dates, functions etc. It also encapsulates the Regular Expressions, Errors, JSON, Promises. You can easily copy paste the code examples for your projects.

9. JavaScript in One Pic

This is a beautiful representation of JavaScript Cheat Sheet in a single picture. You can find it in GitHub repository. It's like a tree of JavaScript syntax. Every branch of which indicates a JavaScript method or function. The left portion of the tree tells about the scope of JavaScript elements including the global, execution context, scope chain, and closure. Whereas the right branches explain about functions, identifiers, comments, data type, operators, reference type & flow control. The extreme nodes have example code. A graphical representation is always beneficial when it comes to interpret and memorize plain text. It is great to understand the flow and structure of JavaScript syntax.

10. Dummies Cheat Sheet

This JavaScript Cheat Sheet is in tabular form. Contains all the JavaScript syntax including variables, functions, and methods with description. It has classified the syntax in Variable Manipulation functions, Basic I/O commands, Structural Conditioning, Objects, DOM Methods, Regular expressions etc. Includes main jQuery selector and Filters.

11. Codepen Cheat Sheet

It is a simple reference JavaScript Cheat Sheet on Codepen. It mainly divides into three parts based on its working: Data Object Methods (DOM), JS, Functions. Each part associates with some major operations. It gives the different JavaScript commands to execute the particular tasks. For Example, to create DOM elements, to add object properties, to set default values to functions and much more. You can scroll down sequentially to see all the details or can jump to any particular section with the help of the clickable links specified on the top of the cheat sheet.

12. JavaScript Cheat Sheet

This JavaScript Cheat Sheet is maintained on XUL. It has separate sections to help the user to find which variable, operator, function or method is used for performing a specific task. Each section covers most of the relevant operations to serve the user purpose. The main sections are Types of variables, Event Handlers, Date, array, index and String methods, functions, Regular expressions etc. It only gives the name of the operation or variable. For more details about that particular element, you need to go on the links in the left corner of the window.

13. Modern JS Cheatsheet

Modern JS Cheat Sheet helps the developers to get familiar with basics of JavaScript. This guide is very well-framed with a table of contents. A user can jump to any required section from the table of contents. It covers all the basics like variables, constants, array functions, classes, generators, static methods etc. Whatever section it includes, gives complete information about it, from a short explanation, sample code to the detailed explanation. It also marks the external resources to get further details. This is one of the best JavaScript cheat sheets to have a good command over this language.

14. The Ultimate JavaScript Cheat Sheet

The ultimate JavaScript Cheat Sheet not only gives an overview of the JavaScript language but also includes a couple of browser features. It covers all the basics plus error handling in JavaScript. It gives a small description, language rules, example code for every enlisted element. The main elements are variables, conditional statements, objects, classes, constructors, async function, promises etc. It also embraces loops, math & number functions, date functions.

15. JavaScript Encyclopedia

This is a JavaScript encyclopedia organized into 27 chapters. Every chapter contains a list of specimens (concepts). All these specimens are arranged alphabetically. Each specimen can include multiple articles. These are well-maintained with further links. This encyclopedia covers all the basics of JavaScript in addition to the special characters.

16. JavaScript Cheat Sheet

This is a special JavaScript Cheat Sheet. It only includes different types of expression, properties and some of the main functions of JavaScript. Comprises of Trivial expressions, Operator expressions, Composite expressions. It also incorporates Statements, Useful functions, Useful Properties of strings, arrays and maths.

17. JavaScript Cheat Sheet by Sudolabs

This is a short but quick JavaScript cheat sheet to brush-up your JavaScript language basics. It has arranged all the elements into some major sections like Output, DOM methods, Events, Variables, Loops, String Functions, Conditional Statements etc.

18. JavaScript Cheat Sheet by Hemsen

This JavaScript Cheat Sheet is formulated by Holmer Hemsen. First, it tells about the structure of a JavaScript document. It goes further step by step by explaining the brief details from Semicolon, Whitespaces to Event Handling. It covers variables, types, arrays, strings, objects & methods, operators, math & date functions to RegExp etc. Available in PDF format.javascript cheat sheet

19. JavaScript Quick Reference Card

Cheat

2. OverAPI Cheat Sheet

It is a comprehensive JavaScript Cheat sheet from the OverAPI collection of cheat sheets. Not only it groups the hole JavaScript syntax at one place but also redirects you to new links for the further details. It means whenever you click a specific element, it opens a new page that contains its syntax, short summary, and description with an example. Covers all the basic functions plus Graphics Methods and DOM properties. It is a great JavaScript resource as holds everything you need to know about it.

MediaTek's Helio G90 Series combines the latest Arm Cortex-A76 & Cortex-A55 CPUs in an octa-core combination. With a large L3 cache and speeds of up to 2.05GHz, it noticeably boosts speeds in demanding games and apps. Mtk g90. The MTK Helio G90 can support up to 48MP single camera or Dual 24MP+16MP for both back and front side. It comes with up 1080 x 2520 pixels Full HD+ display and up to10GB LPDDR4X RAM support. All the essential connectivity features are available such as Bluetooth 5.0, Dual VoLTE voice calling, GPS, dual-band Wi-Fi 5 (a/b/g/n/ac), NFC and FM Radio.

3. FirstSiteGuide Cheat Sheet

You can get a fancy JavaScript Cheat Sheet on FirstSiteGuide. It is a good exposure to JavaScript syntax for beginners. Gives you a brief overview of JavaScript variables, commands, functions, and methods under different categories. This colorful JavaScript collaboration is easy to refer and follow.

4. DOM JavaScript Cheat Sheet (PDF)

This cheat sheet is assembled by Christian Heilmann. It is a collection of the most commonly used DOM methods in JavaScript. It is really useful to locate an element, for navigating between nodes, reading element attributes and node values etc. Even, you can create new nodes.

5. JavaScript Regex Cheatsheet

In JavaScript, regular expressions are objects to match character combinations in strings. These are used with different methods of a string. So, this JavaScript Regex cheat sheet covers all the regex basics, quantifiers, classes to Regex replacement. It also includes Regex groups, assertions, and Regex flags. In whole, it is good quick reference to all the concepts associated with JavaScript Regular expressions.

6. JavaScript (ES6 and Beyond) Cheat Sheet

This JavaScript Cheat Sheet refers to the latest standard specification ES6 of JavaScript. ECMAScript (ES6) is a new JavaScript implementation. It focuses that how to create a scripting language. This cheat sheet displays the ES6 features of JavaScript. It represents ES6 variable, constants, Binary, Hex, and Octal notation, Arrow, and new scoped functions and much more. It is one of the best resources to get aware of new ES6 elements and concepts.

7. React.js Cheat Sheet

This cheat sheet represents a JavaScript library for creating user interfaces. It has a number of sections to target React v15 to v16. It covers the basic components, defaults, lifecycle, DOM nodes, JSX patterns, property validation etc. Each section divides into relevant sets of operation. Rollbar sponsors this cheat sheet. Rollbar is responsible for real-time error monitoring, analytics & altering for developers.

8. Interactive JavaScript Cheat Sheet

This JavaScript Cheat Sheet summarizes the all useful elements on a single page. It marks the code example for every element included. Contains different sections for loops, variables, arrays, strings, events, numbers, dates, functions etc. It also encapsulates the Regular Expressions, Errors, JSON, Promises. You can easily copy paste the code examples for your projects.

9. JavaScript in One Pic

This is a beautiful representation of JavaScript Cheat Sheet in a single picture. You can find it in GitHub repository. It's like a tree of JavaScript syntax. Every branch of which indicates a JavaScript method or function. The left portion of the tree tells about the scope of JavaScript elements including the global, execution context, scope chain, and closure. Whereas the right branches explain about functions, identifiers, comments, data type, operators, reference type & flow control. The extreme nodes have example code. A graphical representation is always beneficial when it comes to interpret and memorize plain text. It is great to understand the flow and structure of JavaScript syntax.

10. Dummies Cheat Sheet

This JavaScript Cheat Sheet is in tabular form. Contains all the JavaScript syntax including variables, functions, and methods with description. It has classified the syntax in Variable Manipulation functions, Basic I/O commands, Structural Conditioning, Objects, DOM Methods, Regular expressions etc. Includes main jQuery selector and Filters.

11. Codepen Cheat Sheet

It is a simple reference JavaScript Cheat Sheet on Codepen. It mainly divides into three parts based on its working: Data Object Methods (DOM), JS, Functions. Each part associates with some major operations. It gives the different JavaScript commands to execute the particular tasks. For Example, to create DOM elements, to add object properties, to set default values to functions and much more. You can scroll down sequentially to see all the details or can jump to any particular section with the help of the clickable links specified on the top of the cheat sheet.

12. JavaScript Cheat Sheet

This JavaScript Cheat Sheet is maintained on XUL. It has separate sections to help the user to find which variable, operator, function or method is used for performing a specific task. Each section covers most of the relevant operations to serve the user purpose. The main sections are Types of variables, Event Handlers, Date, array, index and String methods, functions, Regular expressions etc. It only gives the name of the operation or variable. For more details about that particular element, you need to go on the links in the left corner of the window.

13. Modern JS Cheatsheet

Modern JS Cheat Sheet helps the developers to get familiar with basics of JavaScript. This guide is very well-framed with a table of contents. A user can jump to any required section from the table of contents. It covers all the basics like variables, constants, array functions, classes, generators, static methods etc. Whatever section it includes, gives complete information about it, from a short explanation, sample code to the detailed explanation. It also marks the external resources to get further details. This is one of the best JavaScript cheat sheets to have a good command over this language.

14. The Ultimate JavaScript Cheat Sheet

The ultimate JavaScript Cheat Sheet not only gives an overview of the JavaScript language but also includes a couple of browser features. It covers all the basics plus error handling in JavaScript. It gives a small description, language rules, example code for every enlisted element. The main elements are variables, conditional statements, objects, classes, constructors, async function, promises etc. It also embraces loops, math & number functions, date functions.

15. JavaScript Encyclopedia

This is a JavaScript encyclopedia organized into 27 chapters. Every chapter contains a list of specimens (concepts). All these specimens are arranged alphabetically. Each specimen can include multiple articles. These are well-maintained with further links. This encyclopedia covers all the basics of JavaScript in addition to the special characters.

16. JavaScript Cheat Sheet

This is a special JavaScript Cheat Sheet. It only includes different types of expression, properties and some of the main functions of JavaScript. Comprises of Trivial expressions, Operator expressions, Composite expressions. It also incorporates Statements, Useful functions, Useful Properties of strings, arrays and maths.

17. JavaScript Cheat Sheet by Sudolabs

This is a short but quick JavaScript cheat sheet to brush-up your JavaScript language basics. It has arranged all the elements into some major sections like Output, DOM methods, Events, Variables, Loops, String Functions, Conditional Statements etc.

18. JavaScript Cheat Sheet by Hemsen

This JavaScript Cheat Sheet is formulated by Holmer Hemsen. First, it tells about the structure of a JavaScript document. It goes further step by step by explaining the brief details from Semicolon, Whitespaces to Event Handling. It covers variables, types, arrays, strings, objects & methods, operators, math & date functions to RegExp etc. Available in PDF format.javascript cheat sheet

19. JavaScript Quick Reference Card

This reference card is a summary of JavaScript. It includes all of the Code structure, Nomenclature rules, Visibility & scope to Objects. It describes an element with its proper notation. The main sections are Variables, Looping, Array objects, Error handling, JavaScript in HTML, Conditional Execution, Window Objects etc.

20. All-In-One Cheat Sheet

This is an Ultimate JavaScript Cheat Sheet that covers everything from basic objects to graphics. It includes browser functions, DOM events, RegExp, Conditionals, Timers, Loops, Type checking, throttle functions etc. In addition to this, it also tells how to create or add new elements to DOM, Add/Remove classes or array items, add default arguments for functions and much more.

21. JavaScript: Basic, Advanced, & More Cheat Sheet by AC Winter

This cheat sheet covers all the core elements of JavaScript though not in detail but to mark a reference. The main sections are of Types, Math Methods, Array, Functions, Loops, Strings, Date Methods etc. Backblaze data privacy. It also includes the Miscellaneous Instructions to perform some specific operations like breaking/stopping the current loop etc. Similarly, it has a separate section to define some relative language terms such as Callback, Chaining, ECMAScript, Arity, Currying, IIFE and much more. It also enlists some of the Reserved Keywords for JavaScript.

22. JavaScript Object Methods Cheat Sheet by anas_95

This JavaScript Cheat Sheet only contains the object methods. There are five main object methods for Strings, Maths, Arrays, Numbers, and Data. Each section includes the relevant methods with name and a short description. It is an easy reference guide, also available in PDF format to download.

23. JavaScript for Java Developers

This is a great JavaScript resource for the Java developers. It deals with the frequent pain points by comparing different elements of both the languages. Tells about the importance of learning JavaScript in the Java world. Explains some of the core concepts. Like having only objects and no classes, this keyword, Functions as values, Classic vs Prototypal inheritance etc. It also includes the Constructors, Closures, Modules, Block Scope and much more.

To Bind Up

JavaScript has a high potential for building cutting-edge web applications. But, it's really tough to memorize it by heart. So, the JavaScript cheat sheets act perfectly as a reminder and comprehensive reference for the developers. All the popular and special purpose cheat sheets are discussed above. Now, you have your own great database of JavaScript cheat sheets. So, enjoy working with your JavaScript coding!!

JavaScript is the most powerful tool of the front-end development, and with continuous updates & frameworks JavaScript can also be used as the back-end tool. Here in this article, we have provided a cheat sheet for all the basic JavaScript. We have also provided the code snippet which you can directly copy if somewhere you get confused with the syntax.

Basic JavaScript Cheatsheet

We can include JavaScript in our HTML file in two ways.

Internal Including of Java Script

In this, we write the JavaScript code in the HTML pages itself inside the tag</p><p><strong>External Including of JavaScript</strong></p><h2>Javascript Operators Cheat Sheet</h2><p>In this method, we create a JavaScript document with an extension of .js and include it to our HTML page.</p><h3><strong>Comments in JavaScript</strong></h3><p>Comments are used to provide additional information about the code.</p><p>In JS we use <strong>//</strong> to comment out a single line and <strong>/* </strong>to comment out multiple lines</p><p><strong>Example:</strong></p><h3><strong>Java Script Variable</strong></h3><h2>Javascript Operators Cheat Sheet For Beginners</h2><p>In JS we have 3 keywords that we can use to declare a variable.</p><table><tbody><tr><td width='94'><strong>Variable </strong></td><td width='306'><strong>Description</strong></td><td width='200'><strong>Code Snippet</strong></td></tr><tr><td width='94'>var</td><td width='306'><strong>var </strong>keyword is used to assign a variable. As JavaScript is a dynamic language so we do not need to specify the specific data type.</td><td width='200'>var num_1 = 10;</td></tr><tr><td width='94'>const</td><td width='306'><strong>const </strong>is a keyword which is used to assign a variable, once we assign a variable with <strong>const </strong>we cannot modify its value</td><td width='200'>const num_2 = 20;</td></tr><tr><td width='94'>let</td><td width='306'>It is similar to const, but a let variable can be reassigned but not re-declared</td><td width='200'>let num_2 = 30;</td></tr></tbody></table><h3><strong>Data Types in JavaScript</strong></h3><table><tbody><tr><td width='301'><strong>Data type</strong></td><td width='301'><strong>Code Snippet</strong></td></tr><tr><td width='301'><strong>Number</strong></td><td width='301'>var x = 100;</td></tr><tr><td width='301'><strong>String</strong></td><td width='301'>var x = '100'</td></tr><tr><td width='301'><strong>Boolean</strong></td><td width='301'>var x =true;</td></tr><tr><td width='301'><strong>null</strong></td><td width='301'>var x = null;</td></tr><tr><td width='301'><strong>Object</strong></td></tr></tbody></table><h3><strong>Array in JavaScript</strong></h3><h3><strong>Array Methods</strong></h3><table><tbody><tr><td width='301'><strong>Methods</strong></td><td width='301'><strong>Description</strong></td></tr><tr><td width='301'>concat()</td><td width='301'>Join arrays to make one single array</td></tr><tr><td width='301'>indexOf()</td><td width='301'>To get the index of a value</td></tr><tr><td width='301'>join()</td><td width='301'>Combine all elements of an Array to make it a string</td></tr><tr><td width='301'>lastIndexOf()</td><td width='301'>Give the last position of the array</td></tr><tr><td width='301'>pop()</td><td width='301'>Remove the last element of the array</td></tr><tr><td width='301'>push()</td><td width='301'>Add new element at the end of an array</td></tr><tr><td width='301'>reverse()</td><td width='301'>Revere the array element</td></tr><tr><td width='301'>shift()</td><td width='301'>Remove the first element of the array</td></tr><tr><td width='301'>slice()</td><td width='301'>Create a new sequence of an array from the existing one</td></tr><tr><td width='301'>sort()</td><td width='301'>Sort the elements of the array</td></tr><tr><td width='301'>splice()</td><td width='301'>Add elements in a specified way and position</td></tr><tr><td width='301'>toString()</td><td width='301'>Convent elements to the string</td></tr><tr><td width='301'>unshift()</td><td width='301'>Add an element at the beginning of an array</td></tr><tr><td width='301'>valueOf()</td><td width='301'>Return the position of the element</td></tr></tbody></table><h3><strong>Operators in JavaScript</strong></h3><p>In JS we have many types of Operators, such as Arithmetic, conditional, logical and Bitwise operator operators.</p><p>Operators are the special symbol, we use to perform a specific task, and the operators always need operands to work.</p><h3><strong>Arithmetic Operators</strong></h3><table><tbody><tr><td width='94'><strong>Operators</strong></td><td width='306'><strong>Operator Name </strong></td><td width='200'><strong>Code snippet</strong></td></tr><tr><td width='94'>+</td><td width='306'>Addition</td><td width='200'>1 + 2 //3</td></tr><tr><td width='94'>–</td><td width='306'>Subtraction</td><td width='200'>2 – 1 //1</td></tr><tr><td width='94'>*</td><td width='306'>Multiplication</td><td width='200'>2*2 //2</td></tr><tr><td width='94'>/</td><td width='306'>Division</td><td width='200'>4/2 //2</td></tr><tr><td width='94'>%</td><td width='306'>Modules or remainder</td><td width='200'>10%2 //0</td></tr><tr><td width='94'>++</td><td width='306'>Increment</td></tr><tr><td width='94'>—</td><td width='306'>decrement</td></tr></tbody></table><p><strong>Comparison: </strong>It returns true or false value</p><table><tbody><tr><td width='94'><strong>Operators</strong></td><td width='306'><strong>Operator Name </strong></td></tr><tr><td width='306'>Equal to</td></tr><tr><td width='306'>Equal value and data type</td></tr><tr><td width='94'>!=</td><td width='306'>Not equal</td></tr><tr><td width='94'>!</td><td width='306'>Not equal value and data type</td></tr><tr><td width='94'>></td><td width='306'>Greater than</td></tr><tr><td width='94'><</td><td width='306'>less than</td></tr><tr><td width='94'>>=</td><td width='306'>Greater than and equal to</td></tr><tr><td width='94'><=</td><td width='306'>less than and equal to</td></tr><tr><td width='94'>?</td><td width='306'>Ternary Operator</td></tr></tbody></table><p><strong>Logical Operator: </strong>It operates on Boolean value:</p><table><tbody><tr><td width='94'><strong>Operators</strong></td><td width='306'><strong>Operator Name </strong></td></tr><tr><td width='94'>&&</td><td width='306'>and</td></tr><tr><td width='94'>||</td><td width='306'>or</td></tr><tr><td width='94'>!</td><td width='306'>Not</td></tr></tbody></table><p><strong>Bitwise Operator:</strong></p><table><tbody><tr><td width='94'><strong>Operators</strong></td><td width='306'><strong>Operator Name </strong></td></tr><tr><td width='94'>&</td><td width='306'>AND statement</td></tr><tr><td width='94'>|</td><td width='306'>OR statement</td></tr><tr><td width='94'>~</td><td width='306'>Not</td></tr><tr><td width='94'>^</td><td width='306'>XOR</td></tr><tr><td width='94'><<</td><td width='306'>Left shift</td></tr><tr><td width='94'>>></td><td width='306'>Right Shift</td></tr><tr><td width='94'>>>></td><td width='306'>Zero fill right shift</td></tr></tbody></table><h4><strong>Function</strong></h4><p>Functions are used to perform a specific task.</p><p><strong>User-defined functions in JavaScript:</strong></p><p><strong>Show Output on Screen</strong></p><p>In JS we have some inbuilt functions which are used to show output or print something on the screen.</p><table><tbody><tr><td width='186'><strong>Output Function</strong></td><td width='209'><strong>Description</strong></td><td width='207'><strong>Code Snippet</strong></td></tr><tr><td width='186'>alert()</td><td width='209'>An alert box show a box</td><td width='207'>alert('Hello world')</td></tr><tr><td width='186'>confirm()</td><td width='209'>It is similar to alert but it returns value in the form of true or false</td><td width='207'>confirm('Are you 18+')</td></tr><tr><td width='186'>console.log()</td><td width='209'>It is used to write information on the browser console</td><td width='207'>console.log('Hello world')</td></tr><tr><td width='186'>document.write()</td><td width='209'>It can write in HTML document</td><td width='207'>document.write('Hello world')</td></tr><tr><td width='186'>prompt()</td><td width='209'>It is used to take data from the user</td><td width='207'>prompt('Enter Your name')</td></tr></tbody></table><h3><strong>JavaScript Global Functions</strong></h3><table><tbody><tr><td width='301'><strong>Global Functions</strong></td><td width='301'><strong>Description</strong></td></tr><tr><td width='301'>decodeURI()</td><td width='301'>Decode a Uniform Resource iIdentifiers(URI)</td></tr><tr><td width='301'>decodeURIComponent()</td><td width='301'>Decode a URI component</td></tr><tr><td width='301'>endodeURI()</td><td width='301'>Encode a URI into UTF-8</td></tr><tr><td width='301'>encodeURIComponent()</td><td width='301'>Encode URI components</td></tr><tr><td width='301'>eval()</td><td width='301'>Evaluate the code represent in the string format</td></tr><tr><td width='301'>isFinite()</td><td width='301'>Evaluate whether the value is finite or not</td></tr><tr><td width='301'>isNaN()</td><td width='301'>Evaluate whether the value is NaN or Not</td></tr><tr><td width='301'>Number()</td><td width='301'>Convert the string into a number</td></tr><tr><td width='301'>parseFloat()</td><td width='301'>Parse the value and return into a floating-point number</td></tr><tr><td width='301'>parseInt()</td><td width='301'>Parse the value and return an Integer</td></tr></tbody></table><h3><strong>Loops in JavaScript</strong></h3><p>Loop is used to iterate over a block of Statement again and again till a certain condition.</p><p>In JS we have 3 types of statements that can loop over a statement.</p><table><tbody><tr><td width='200'><strong>Loop</strong></td><td width='215'><strong>Description</strong></td><td width='187'><strong>Code Snippet</strong></td></tr><tr><td width='200'>for</td><td width='215'>We use for a loop when we are certain about how many times we are going to iterate over a block of code.</td><td width='187'>for( var i=0; i<10; i++)<p>{</p><p>console.log(i);</p><p>}</p></td></tr><tr><td width='200'>while</td><td width='215'>When we are not certain about how many times, we need to iterate over a block</td><td width='187'>while(i<10)<p>{</p><p>console.log(i);</p><p>i++;</p><p>}</p></td></tr><tr><td width='200'>do while</td><td width='215'>No matter what, even the condition is false at first place to do while will execute a minimum 1 time.</td><td width='187'>do<p>{</p><p>console.log(i)</p><p>i++;</p><p>}while(i<10)</p></td></tr></tbody></table><p><strong>break: </strong>Break is a keyword we use in loop to stop and exit the cycle of the loop.</p><p><strong>continue: </strong>Continue is used to skip a cycle of the loop.</p><h2>Javascript Operators Cheat Sheet Example</h2><p><strong>JavaScript If…Else:</strong></p><h2>Javascript Operators Cheat Sheet Pdf</h2><h4><strong>Twists</strong></h4><p>A string is a collection of characters inside the double or single inverted commas.</p><p><strong>String Methods</strong></p><table><tbody><tr><td width='301'><strong>Methods</strong></td><td width='301'><strong>Description</strong></td></tr><tr><td width='301'>charAt()</td><td width='301'>Return the position of the character inside a string.</td></tr><tr><td width='301'>charCodeAt()</td><td width='301'>Provide the Unicode of the character</td></tr><tr><td width='301'>Concat()</td><td width='301'>Join two or more strings into one</td></tr><tr><td width='301'>fromCharCode()</td><td width='301'>Return a string created from the specified sequence of UTF-16 code units</td></tr><tr><td width='301'>indexOf()</td><td width='301'>Returns the position of the character</td></tr><tr><td width='301'>lastIndexOf()</td><td width='301'>Provide the last index of the character if there is more than one same character in the string.</td></tr><tr><td width='301'>match()</td><td width='301'>Retrieves the matches of a string against a search pattern.</td></tr><tr><td width='301'>replace()</td><td width='301'>Replace a text with another</td></tr><tr><td width='301'>search()</td><td width='301'>Return the position of a text in a string</td></tr><tr><td width='301'>slice()</td><td width='301'>Extract a sequence of string</td></tr><tr><td width='301'>split()</td><td width='301'>Split the string into an array</td></tr><tr><td width='301'>substr()</td><td width='301'>Extract a sequence of string depend on a specified number of characters</td></tr><tr><td width='301'>substring()</td><td width='301'>Similar to slice() but does not work with -ve indices</td></tr><tr><td width='301'>toLoweCase()</td><td width='301'>Covert the string to lowercase</td></tr><tr><td width='301'>toUpperCase()</td><td width='301'>Convert the string to upper case</td></tr><tr><td width='301'>valueOf()</td><td width='301'>Return the primitive value of a String object.</td></tr></tbody></table><h4><strong>Regular Expression</strong></h4><table><tbody><tr><td width='301'><strong>Pattern Modifier</strong></td><td width='301'><strong>Name</strong></td></tr><tr><td width='301'>e</td><td width='301'>Evaluate Replacement</td></tr><tr><td width='301'>i</td><td width='301'>Case-insensitive matching</td></tr><tr><td width='301'>g</td><td width='301'>Global matching</td></tr><tr><td width='301'>m</td><td width='301'>Multiple line matching</td></tr><tr><td width='301'>s</td><td width='301'>Treat string as a single line</td></tr><tr><td width='301'>x</td><td width='301'>Allow comments and whitespace in pattern</td></tr><tr><td width='301'>u</td><td width='301'>Ungreedy pattern</td></tr></tbody></table><table><tbody><tr><td width='301'><strong>Brackets</strong></td><td width='301'><strong>Description</strong></td></tr><tr><td width='301'>[abc]</td><td width='301'>Find any characters from a, b and c</td></tr><tr><td width='301'>[^abc]</td><td width='301'>Find any character except abc</td></tr><tr><td width='301'>[0-9]</td><td width='301'>Find any digit 0 to 9</td></tr><tr><td width='301'>[A-z]</td><td width='301'>Find any character from a to z and A to Z</td></tr><tr><td width='301'>(a | b | c)</td><td width='301'>Find any of the alternatives separated with |</td></tr></tbody></table><h4><strong>Math and Numbers</strong></h4><table><tbody><tr><td width='301'><strong>Number Methods</strong></td><td width='301'><strong>Description</strong></td></tr><tr><td width='301'>toExponential()</td><td width='301'>Return a string with a rounded number written as exponential notation</td></tr><tr><td width='301'>toFixed()</td><td width='301'>Returns the string of a number with a specified number of decimals</td></tr><tr><td width='301'>toPrecision()</td><td width='301'>A string of a number written with a specified length</td></tr><tr><td width='301'>toString()</td><td width='301'>Returns a number as a string</td></tr></tbody></table><table><tbody><tr><td width='301'><strong>Math Methods</strong></td><td width='301'><strong>Description</strong></td></tr><tr><td width='301'>abs(n)</td><td width='301'>Return a positive value of n</td></tr><tr><td width='301'>acos(n)</td><td width='301'>Arccosine of n in radian</td></tr><tr><td width='301'>asin(n)</td><td width='301'>Arcsine of n in radians</td></tr><tr><td width='301'>atan(n)</td><td width='301'>The arctangent of n in numeric value</td></tr><tr><td width='301'>ceil(n)</td><td width='301'>The rounded-up value of n</td></tr><tr><td width='301'>cos(n)</td><td width='301'>Cosine of n</td></tr><tr><td width='301'>exp(n)</td><td width='301'>Ex of n</td></tr><tr><td width='301'>floor(n)</td><td width='301'>Rounded down value of n</td></tr><tr><td width='301'>log(n)</td><td width='301'>The natural logarithm of n</td></tr><tr><td width='301'>max(1,2,3,5,12,42)</td><td width='301'>Return the maximum value</td></tr><tr><td width='301'>min(1,2,3,5,12,42)</td><td width='301'>Return the minimum value</td></tr><tr><td width='301'>pow(n,m)</td><td width='301'>n to the power m</td></tr><tr><td width='301'>random()</td><td width='301'>Return a random value between 1 or 0</td></tr><tr><td width='301'>sin(n)</td><td width='301'>The sine of x in radian</td></tr><tr><td width='301'>sqrt(n)</td><td width='301'>The square root of n</td></tr><tr><td width='301'>tan(n)</td><td width='301'>The tangent of angle n</td></tr></tbody></table><h4><strong>Dates in JS</strong></h4><p>Date()= Return the current date in the form of a new date object.</p><p><strong>Date Declaration</strong></p><h2>Cheat Sheet Recipes</h2><p>Date(yyyy,mm,dd,HH,MM,SS,MS): to create a new date object.</p><h4><strong>Date Methods</strong></h4><table><tbody><tr><td width='301'><strong>Get Date Methods</strong></td><td width='301'><strong>Description</strong></td></tr><tr><td width='301'>getDate()</td><td width='301'>Get the date from the date object</td></tr><tr><td width='301'>getDay()</td><td width='301'>Get the weeday</td></tr><tr><td width='301'>getFullYear()</td><td width='301'>Get the year</td></tr><tr><td width='301'>getHours()</td><td width='301'>Get the hour(0-23)</td></tr><tr><td width='301'>getMilliseconds()</td><td width='301'>Get the millisecond</td></tr><tr><td width='301'>getMinutes()</td><td width='301'>Get the minutes</td></tr><tr><td width='301'>getSeconds()</td><td width='301'>Get the second</td></tr><tr><td width='301'>getTime()</td><td width='301'>Get the milliseconds since January 1, 1970</td></tr><tr><td width='301'>getUTCDate()</td><td width='301'>The day (date) of the month in the specified date according to universal time (also available for day, month, fullyear, hours, minutes etc.)</td></tr><tr><td width='301'>getMonth()</td><td width='301'>Get the month(0-11)</td></tr></tbody></table><table><tbody><tr><td width='301'><strong>Set Date Methods</strong></td><td width='301'><strong>Description</strong></td></tr><tr><td width='301'>setDate()</td><td width='301'>Set the date</td></tr><tr><td width='301'>setFullYear()</td><td width='301'>Set the year</td></tr><tr><td width='301'>setHours</td><td width='301'>Set hours</td></tr><tr><td width='301'>setMilliseconds</td><td width='301'>Set milliseconds</td></tr><tr><td width='301'>setMinutes</td><td width='301'>Set minutes</td></tr><tr><td width='301'>setMonths()</td><td width='301'>Set months</td></tr><tr><td width='301'>setSeconds()</td><td width='301'>Set seconds</td></tr><tr><td width='301'>setTime()</td><td width='301'>Set time</td></tr><tr><td width='301'>setUTCDate()</td><td width='301'>Sets the day of the month for a specified date according to universal time (also available for day, month, fullyear, hours, minutes etc.)</td></tr></tbody></table><h4><strong>DOM in JavaScript</strong></h4><table><tbody><tr><td width='301'><strong>Node Methods</strong></td><td width='301'><strong>Description</strong></td></tr><tr><td width='301'>appendChid()</td><td width='301'>Adds a new child node to an element as the last child node</td></tr><tr><td width='301'>cloneNode()</td><td width='301'>Clone the HTML element</td></tr><tr><td width='301'>compareDocumentPosition()</td><td width='301'>Compare the document position of two elements</td></tr><tr><td width='301'>getFeature()</td><td width='301'>Returns an object which implements the API of a specified feature</td></tr><tr><td width='301'>hasAttributes()</td><td width='301'>True if element has attributes else it return false</td></tr><tr><td width='301'>hasChildNode()</td><td width='301'>Returns true if an element has any child nodes, otherwise fals</td></tr><tr><td width='301'>insertBefore()</td><td width='301'>Insert a new child node before a specified existing child node</td></tr><tr><td width='301'>isDefaultNamespace()</td><td width='301'>True for default specified namespaceURI else false</td></tr><tr><td width='301'>removeChild()</td><td width='301'>Removes a child node from an element</td></tr><tr><td width='301'>replaceChild()</td><td width='301'>Replaces a child node in an element</td></tr></tbody></table><h2>Cheat Sheet Terraria</h2><table><tbody><tr><td width='301'><strong>Elements Methods</strong></td><td width='301'><strong>Description</strong></td></tr><tr><td width='301'>getAttribute()</td><td width='301'>Return the attribute value</td></tr><tr><td width='301'>getAttributeNS()</td><td width='301'>Return the string value of the attribute with namespace</td></tr><tr><td width='301'>getAttributeNode()</td><td width='301'>Get the specific attribute node</td></tr><tr><td width='301'>getAttributeNodeNS()</td><td width='301'>Return the attribute node for the attribute with the given namespace</td></tr><tr><td width='301'>getElementsByTagName()</td><td width='301'>Get all the elements with a specific tag name</td></tr><tr><td width='301'>getElemetsByTagNameNS()</td><td width='301'>Returns a live HTMLCollection of elements with a certain tag name belonging to the given namespace</td></tr><tr><td width='301'>setAttribute()</td><td width='301'>Sets or changes the specified attribute to a specified value</td></tr><tr><td width='301'>setAttributeNS()</td><td width='301'>Adds a new attribute or changes the value of an attribute with the given namespace and name</td></tr><tr><td width='301'>setAttributeNode()</td><td width='301'>Sets or changes the specified attribute node</td></tr><tr><td width='301'>setAttributeNodeNS()</td><td width='301'>Adds a new namespaced attribute node to an element</td></tr></tbody></table><h4><strong>JavaScript Events</strong></h4><h5><strong>Mouse</strong></h5><ul><li>onclick</li><li>oncontextmenu</li><li>ondblclick</li><li>onmousedown</li><li>onmouseenter</li><li>onmouseeleave</li><li>onmousemove</li><li>onmouseover</li></ul><h4><strong>Keyboard</strong></h4><h2>Javascript Operators Cheat Sheet Pdf</h2><ul><li>onkeydown</li><li>onkeypress</li><li>onkeyup</li></ul><h4><strong>Form</strong></h4><ul><li>onblur</li><li>onchange</li><li>onfocus</li><li>onfocusin</li><li>onfocusout</li><li>oninput</li><li>oninvalid</li><li>onrest</li><li>onsearch</li><li>onselect</li><li>onsubmit</li></ul><h4><strong>Drag</strong></h4><ul><li>ondrag</li><li>ondragend</li><li>ondragenter</li><li>ondragleave</li><li>ondragover</li><li>ondragstart</li><li>ondrop</li></ul><h4><strong>Media</strong></h4><ul><li>onabort,</li><li>oncanplay,</li><li>oncanplaythrough,</li><li>ondurationchange,</li><li>onended,</li><li>onerror,</li><li>onloadeddata,</li><li>onloadedmetadata,</li><li>onloadstart,</li><li>onpause,</li><li>onplay,</li><li>onplaying,</li><li>onprogress,</li><li>onratechange,</li><li>onseeked,</li><li>onseeking,</li><li>onstalled,</li><li>onsuspend,</li><li>ontimeupdate,</li><li>onvolumechange,</li><li>onwaiting</li></ul><p><strong>You may also Interested In:</strong></p><br><br><br><br>

broken image