JavaScript reference

Constructs and Commands

condition condition alternative condition alternative multiple choice loop loop loop for arrays loop for objects loop stop next iteration function creation object property deletion property existence check code string execution array creation object creation

Typing

convert to number string to number string to fraction convert to string convert to boolean variable type finite number check NaN check

Special Values

element value is true element value is false not a number element value is null undefined infinity

Mathematical Methods

random number rounding a number rounding up rounding down rounding a number rounding a number square root of a number power of a number maximum number minimum number absolute value of a number

Rare Methods

sine of a number cosine of a number tangent of a number arcsine of a number arccosine of a number arctangent of a number exponent natural logarithm exponential notation

Constants

Pi number exponent value natural logarithm of 2 natural logarithm of 10 logarithm of e to base 2 logarithm of e to base 10 square root of 1/2 square root of 2

Strings

string length lower case upper case splitting a string into an array substring extraction substring extraction substring extraction concatenating strings searching matches from the beginning searching matches from the end checking the beginning checking the end removing whitespace from edges string character character by its code character code search and replace string character by position padding a string from the end to a given length padding a string from the beginning to a given length creating string copies removing whitespace at the end of a string removing whitespace at the beginning of a string searching for a given string in the current string

Regular Expressions

search and replace with regex regex matches all regex matches sequential search testing with regex searching with regex splitting a string into an array

Arrays

array length merging arrays together merging an array into a string array reversal checking for presence in an array searching an array searching an array from the end slicing a part of an array splicing a part of an array removing the first element removing the last element adding elements to the beginning adding elements to the end iterating over an array iterating over an array filtering an array everything in an array at least one in an array reducing to a value reducing to a value array sorting filling an array finding an element in an array finding the index of an element in an array finding an element from the end of an array finding the index of an element from the end of an array getting an array from subarrays getting an array from subarrays checking if an object is an array getting an array from an array-like object getting an array from parameters array element by position

Time

date object get year get month get day of month get hours get minutes get seconds get milliseconds get day of week date in milliseconds date from string set year set month set day of month set hour set minute set second set millisecond current date in milliseconds

Timers

code execution timer code execution pause timer reset pause reset

Getting Elements

element by selector element by id elements by selector elements by tag elements by class parent by selector matching selector nesting check

Getting Relatives

all element descendants child nodes first descendant first descendant node last descendant last descendant node previous element next element parent element parent node

Table Parts

table rows array table cells array table thead table tfoot table tbody

Creating Elements

creating an element cloning a node creating a text node

Inserting Elements

inserting at the beginning inserting at the end inserting at the end inserting before inserting elements inserting HTML code inserting text

Removal

removing nodes removal

Text and Tag

element text element HTML code outer HTML code of element node value node value tag name

Attributes

getting element attributes changing element attributes removing element attributes checking for attribute presence data- attributes

CSS Classes

object with classes adding classes removing classes toggling classes checking classes

Working with CSS

style in one line style from CSS

Dimensions

full width full height left border top border content width content height

Offsets

positioned parent top offset left offset element coordinates element at coordinates

Events

event binding event removal list of event types

Event Object

canceling default action event type element where the event occurred element the event was assigned to whether the event is genuine whether Ctrl is pressed whether Alt is pressed whether Shift is pressed whether Cmd is pressed mouse coordinates mouse coordinates mouse coordinates mouse coordinates button code value entered character

Advanced

event constructor event simulation set focus remove focus

Context

calling a function with context calling a function with context binding context function call context

Objects

array of object properties array of object values object copying

Dialog Windows

message window confirmation window data input window

Basic

pen movement line drawing rectangle outline rectangle shape rectangle circle, arc rectangle erasure

General

line beginning shape completion outline stroking shape filling

Settings

line thickness outline color fill color line end style line join style line join sharpness

Text Work

text text outline text font horizontal alignment vertical alignment text direction

Utility

getting started
English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline