Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

In JavaScript, it's important to understand and properly use these keywords to write effective and functional code. Misusing them or misunderstanding their functionalities can lead to errors or unexpected behavior in your programs.

Rating
-
Sold
-
Pages
29
Uploaded on
28-03-2024
Written in
2023/2024

They cannot be used as identifiers (such as variable names or function names) because they are part of the language syntax. Some common keywords in JavaScript include "var", "let", "const" for variable declaration, "function" for defining functions, "if", "else", "switch", "case", "default" for control flow, "return" for returning values from functions, "for", "while", "do-while" for loops, "try", "catch", "finally" for exception handling, and "class", "extends", "super" for object-oriented programming constructs. In JavaScript, it's important to understand and properly use these keywords to write effective and functional code. Misusing them or misunderstanding their functionalities can lead to errors or unexpected behavior in your programs.

Show more Read less
Institution
Course

Content preview

Beginner’s Essential

Javascript Cheat Sheet




The language of the web.

,Table of Contents

Javascript Basics 2

Variables 2

Arrays 3

Operators 4

Functions 5

Loops 7

If - Else Statements 7

Strings 7

Regular Expressions 9

Numbers and Math 10

Dealing with Dates 12

DOM Node 14

Working with the Browser 18

Events 21

Errors 27




WebsiteSetup.org - Beginner’s Javascript Cheat Sheet ​ ​1

, Javascript Basics

Including JavaScript in an HTML Page
<script type="text/javascript">
//JS code goes here
</script>


Call an External JavaScript File
<script src="myscript.js"></script><code></code>


Including Comments
//
Single line comments

/* comment here */
Multi-line comments


Variables

var, const, let
var
The most common variable. Can be reassigned but only accessed within a function. Variables
defined with var move to the top when code is executed.

const
Cannot be reassigned and not accessible before they appear within the code.

let
Similar to const, however, let variable can be reassigned but not re-declared.


Data Types
var age = 23
Numbers

var x
Variables



WebsiteSetup.org - Beginner’s Javascript Cheat Sheet ​ ​2

Written for

Institution
Course

Document information

Uploaded on
March 28, 2024
Number of pages
29
Written in
2023/2024
Type
Class notes
Professor(s)
Yuva
Contains
All classes

Subjects

$14.40
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
yuvasri

Get to know the seller

Seller avatar
yuvasri Abingdon Whitney College, Abingdon
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions