Javascript Reference

Javascript Resources

Results: 242

ID Resource Description Type Group
1 concat() Joins two or more arrays, and returns a copy of the joined arrays Array Methods Method
2 copyWithin() Copies array elements within the array, to and from specified positions Array Methods Method
3 entries() Returns a key/value pair Array Iteration Object Array Methods Method
4 every() Checks if every element in an array pass a test Array Methods Method
5 fill() Fill the elements in an array with a static value Array Methods Method
6 filter() Creates a new array with every element in an array that pass a test Array Methods Method
7 find() Returns the value of the first element in an array that pass a test Array Methods Method
8 findIndex() Returns the index of the first element in an array that pass a test Array Methods Method
9 forEach() Calls a function for each array element Array Methods Method
10 from() Creates an array from an object Array Methods Method
11 includes() Check if an array contains the specified element Array Methods Method
12 indexOf() Search the array for an element and returns its position Array Methods Method
13 isArray() Checks whether an object is an array Array Methods Method
14 join() Joins all elements of an array into a string Array Methods Method
15 keys() Returns a Array Iteration Object, containing the keys of the original array Array Methods Method
16 lastIndexOf() Search the array for an element, starting at the end, and returns its position Array Methods Method
17 map() Creates a new array with the result of calling a function for each array element Array Methods Method
18 pop() Removes the last element of an array, and returns that element Array Methods Method
19 push() Adds new elements to the end of an array, and returns the new length Array Methods Method
20 reduce() Reduce the values of an array to a single value (going left-to-right) Array Methods Method
21 reduceRight() Reduce the values of an array to a single value (going right-to-left) Array Methods Method
22 reverse() Reverses the order of the elements in an array Array Methods Method
23 shift() Removes the first element of an array, and returns that element Array Methods Method
24 slice() Selects a part of an array, and returns the new array Array Methods Method
25 some() Checks if any of the elements in an array pass a test Array Methods Method
26 sort() Sorts the elements of an array Array Methods Method
27 splice() Adds/Removes elements from an array Array Methods Method
28 toString() Converts an array to a string, and returns the result Array Methods Method
29 unshift() Adds new elements to the beginning of an array, and returns the new length Array Methods Method
30 valueOf() Returns the primitive value of an array Array Methods Method
31 toString() Converts a boolean value to a string, and returns the result Boolean Methods Method
32 valueOf() Returns the primitive value of a boolean Boolean Methods Method
33 extends Extends a class (inherit) Class Keywords Method
34 static Defines a static method for a class Class Keywords Method
35 super Refers to the parent class Class Keywords Method
36 getDate() Returns the day of the month (from 1-31) Date Object Methods Method
37 getDay() Returns the day of the week (from 0-6) Date Object Methods Method
38 getFullYear() Returns the year Date Object Methods Method
39 getHours() Returns the hour (from 0-23) Date Object Methods Method
40 getMilliseconds() Returns the milliseconds (from 0-999) Date Object Methods Method
41 getMinutes() Returns the minutes (from 0-59) Date Object Methods Method
42 getMonth() Returns the month (from 0-11) Date Object Methods Method
43 getSeconds() Returns the seconds (from 0-59) Date Object Methods Method
44 getTime() Returns the number of milliseconds since midnight Jan 1 1970, and a specified date Date Object Methods Method
45 getTimezoneOffset() Returns the time difference between UTC time and local time, in minutes Date Object Methods Method
46 getUTCDate() Returns the day of the month, according to universal time (from 1-31) Date Object Methods Method
47 getUTCDay() Returns the day of the week, according to universal time (from 0-6) Date Object Methods Method
48 getUTCFullYear() Returns the year, according to universal time Date Object Methods Method
49 getUTCHours() Returns the hour, according to universal time (from 0-23) Date Object Methods Method
50 getUTCMilliseconds() Returns the milliseconds, according to universal time (from 0-999) Date Object Methods Method
51 getUTCMinutes() Returns the minutes, according to universal time (from 0-59) Date Object Methods Method
52 getUTCMonth() Returns the month, according to universal time (from 0-11) Date Object Methods Method
53 getUTCSeconds() Returns the seconds, according to universal time (from 0-59) Date Object Methods Method
54 getYear() Deprecated. Use the getFullYear() method instead Date Object Methods Method
55 now() Returns the number of milliseconds since midnight Jan 1, 1970 Date Object Methods Method
56 parse() Parses a date string and returns the number of milliseconds since January 1, 1970 Date Object Methods Method
57 setDate() Sets the day of the month of a date object Date Object Methods Method
58 setFullYear() Sets the year of a date object Date Object Methods Method
59 setHours() Sets the hour of a date object Date Object Methods Method
60 setMilliseconds() Sets the milliseconds of a date object Date Object Methods Method
61 setMinutes() Set the minutes of a date object Date Object Methods Method
62 setMonth() Sets the month of a date object Date Object Methods Method
63 setSeconds() Sets the seconds of a date object Date Object Methods Method
64 setTime() Sets a date to a specified number of milliseconds after/before January 1, 1970 Date Object Methods Method
65 setUTCDate() Sets the day of the month of a date object, according to universal time Date Object Methods Method
66 setUTCFullYear() Sets the year of a date object, according to universal time Date Object Methods Method
67 setUTCHours() Sets the hour of a date object, according to universal time Date Object Methods Method
68 setUTCMilliseconds() Sets the milliseconds of a date object, according to universal time Date Object Methods Method
69 setUTCMinutes() Set the minutes of a date object, according to universal time Date Object Methods Method
70 setUTCMonth() Sets the month of a date object, according to universal time Date Object Methods Method
71 setUTCSeconds() Set the seconds of a date object, according to universal time Date Object Methods Method
72 setYear() Deprecated. Use the setFullYear() method instead Date Object Methods Method
73 toDateString() Converts the date portion of a Date object into a readable string Date Object Methods Method
74 toGMTString() Deprecated. Use the toUTCString() method instead Date Object Methods Method
75 toISOString() Returns the date as a string, using the ISO standard Date Object Methods Method
76 toJSON() Returns the date as a string, formatted as a JSON date Date Object Methods Method
77 toLocaleDateString() Returns the date portion of a Date object as a string, using locale conventions Date Object Methods Method
78 toLocaleTimeString() Returns the time portion of a Date object as a string, using locale conventions Date Object Methods Method
79 toLocaleString() Converts a Date object to a string, using locale conventions Date Object Methods Method
80 toString() Converts a Date object to a string Date Object Methods Method
81 toTimeString() Converts the time portion of a Date object to a string Date Object Methods Method
82 toUTCString() Converts a Date object to a string, according to universal time Date Object Methods Method
83 UTC() Returns the number of milliseconds in a date since midnight of January 1, 1970, according to UTC time Date Object Methods Method
84 valueOf() Returns the primitive value of a Date object Date Object Methods Method
85 decodeURI() Decodes a URI Global Functions Method
86 decodeURIComponent() Decodes a URI component Global Functions Method
87 encodeURI() Encodes a URI Global Functions Method
88 encodeURIComponent() Encodes a URI component Global Functions Method
89 escape() Deprecated in version 1.5. Use encodeURI() or encodeURIComponent() instead Global Functions Method
90 eval() Evaluates a string and executes it as if it was script code Global Functions Method
91 isFinite() Determines whether a value is a finite, legal number Global Functions Method
92 isNaN() Determines whether a value is an illegal number Global Functions Method
93 Number() Converts an object's value to a number Global Functions Method
94 parseFloat() Parses a string and returns a floating point number Global Functions Method
95 parseInt() Parses a string and returns an integer Global Functions Method
96 String() Converts an object's value to a string Global Functions Method
97 unescape() Deprecated in version 1.5. Use decodeURI() or decodeURIComponent() instead Global Functions Method
98 parse() Parses a JSON string and returns a JavaScript object JSON Methods Method
99 stringify() Convert a JavaScript object to a JSON string JSON Methods Method
100 abs(x) Returns the absolute value of x Math Object Methods Method
101 acos(x) Returns the arccosine of x, in radians Math Object Methods Method
102 acosh(x) Returns the hyperbolic arccosine of x Math Object Methods Method
103 asin(x) Returns the arcsine of x, in radians Math Object Methods Method
104 asinh(x) Returns the hyperbolic arcsine of x Math Object Methods Method
105 atan(x) Returns the arctangent of x as a numeric value between -PI/2 and PI/2 radians Math Object Methods Method
106 atan2(y, x) Returns the arctangent of the quotient of its arguments Math Object Methods Method
107 atanh(x) Returns the hyperbolic arctangent of x Math Object Methods Method
108 cbrt(x) Returns the cubic root of x Math Object Methods Method
109 ceil(x) Returns x, rounded upwards to the nearest integer Math Object Methods Method
110 cos(x) Returns the cosine of x (x is in radians) Math Object Methods Method
111 cosh(x) Returns the hyperbolic cosine of x Math Object Methods Method
112 exp(x) Returns the value of Ex Math Object Methods Method
113 floor(x) Returns x, rounded downwards to the nearest integer Math Object Methods Method
114 log(x) Returns the natural logarithm (base E) of x Math Object Methods Method
115 max(x, y, z, ..., n) Returns the number with the highest value Math Object Methods Method
116 min(x, y, z, ..., n) Returns the number with the lowest value Math Object Methods Method
117 pow(x, y) Returns the value of x to the power of y Math Object Methods Method
118 random() Returns a random number between 0 and 1 Math Object Methods Method
119 round(x) Rounds x to the nearest integer Math Object Methods Method
120 sin(x) Returns the sine of x (x is in radians) Math Object Methods Method
121 sinh(x) Returns the hyperbolic sine of x Math Object Methods Method
122 sqrt(x) Returns the square root of x Math Object Methods Method
123 tan(x) Returns the tangent of an angle Math Object Methods Method
124 tanh(x) Returns the hyperbolic tangent of a number Math Object Methods Method
125 trunc(x) Returns the integer part of a number (x) Math Object Methods Method
126 isFinite() Checks whether a value is a finite number Number Methods Method
127 isInteger() Checks whether a value is an integer Number Methods Method
128 isNaN() Checks whether a value is Number.NaN Number Methods Method
129 isSafeInteger() Checks whether a value is a safe integer Number Methods Method
130 toExponential(x) Converts a number into an exponential notation Number Methods Method
131 toFixed(x) Formats a number with x numbers of digits after the decimal point Number Methods Method
132 toLocaleString() Converts a number into a string, based on the locale settings Number Methods Method
133 toPrecision(x) Formats a number to x length Number Methods Method
134 toString() Converts a number to a string Number Methods Method
135 valueOf() Returns the primitive value of a number Number Methods Method
136 compile() Deprecated in version 1.5. Compiles a regular expression RegExp Object Methods Method
137 exec() Tests for a match in a string. Returns the first match RegExp Object Methods Method
138 test() Tests for a match in a string. Returns true or false RegExp Object Methods Method
139 toString() Returns the string value of the regular expression RegExp Object Methods Method
140 constructor Returns the function that created JavaScript's Boolean prototype Boolean Property
141 prototype Allows you to add properties and methods to the Boolean prototype Boolean Property
142 constructor Returns the function that created the Array object's prototype Arrays Property
143 length Sets or returns the number of elements in an array Arrays Property
144 prototype Allows you to add properties and methods to an Array object Arrays Property
145 constructor Returns the function that created the Date object's prototype Date Object Property
146 prototype Allows you to add properties and methods to an object Date Object Property
147 name Sets or returns an error name Error Object Property
148 message Sets or returns an error message (a string) Error Object Property
149 Infinity A numeric value that represents positive/negative infinity Global Properties Property
150 NaN "Not-a-Number" value Global Properties Property
151 undefined Indicates that a variable has not been assigned a value Global Properties Property
152 E Returns Euler's number (approx. 2.718) Math Properties Property
153 LN2 Returns the natural logarithm of 2 (approx. 0.693) Math Properties Property
154 LN10 Returns the natural logarithm of 10 (approx. 2.302) Math Properties Property
155 LOG2E Returns the base-2 logarithm of E (approx. 1.442) Math Properties Property
156 LOG10E Returns the base-10 logarithm of E (approx. 0.434) Math Properties Property
157 PI Returns PI (approx. 3.14) Math Properties Property
158 SQRT1_2 Returns the square root of 1/2 (approx. 0.707) Math Properties Property
159 SQRT2 Returns the square root of 2 (approx. 1.414) Math Properties Property
160 constructor Returns the function that created JavaScript's Number prototype Number Properties Property
161 MAX_VALUE Returns the largest number possible in JavaScript Number Properties Property
162 MIN_VALUE Returns the smallest number possible in JavaScript Number Properties Property
163 NEGATIVE_INFINITY Represents negative infinity (returned on overflow) Number Properties Property
164 NaN Represents a "Not-a-Number" value Number Properties Property
165 POSITIVE_INFINITY Represents infinity (returned on overflow) Number Properties Property
166 prototype Allows you to add properties and methods to an object Number Properties Property
167 constructor Returns the string's constructor function String Properties Property
168 length Returns the length of a string String Properties Property
169 prototype Allows you to add properties and methods to an object String Properties Property
170 constructor Returns the function that created the RegExp object's prototype RegExp Object Properties Property
171 global Checks whether the "g" modifier is set RegExp Object Properties Property
172 ignoreCase Checks whether the "i" modifier is set RegExp Object Properties Property
173 lastIndex Specifies the index at which to start the next match RegExp Object Properties Property
174 multiline Checks whether the "m" modifier is set RegExp Object Properties Property
175 source Returns the text of the RegExp pattern RegExp Object Properties Property
176 n+ Matches any string that contains at least one n RegExp Quantifiers RegExp Object
177 n* Matches any string that contains zero or more occurrences of n RegExp Quantifiers RegExp Object
178 n? Matches any string that contains zero or one occurrences of n RegExp Quantifiers RegExp Object
179 n{X} Matches any string that contains a sequence of X n's RegExp Quantifiers RegExp Object
180 n{X,Y} Matches any string that contains a sequence of X to Y n's RegExp Quantifiers RegExp Object
181 n{X,} Matches any string that contains a sequence of at least X n's RegExp Quantifiers RegExp Object
182 n$ Matches any string with n at the end of it RegExp Quantifiers RegExp Object
183 ^n Matches any string with n at the beginning of it RegExp Quantifiers RegExp Object
184 ?=n Matches any string that is followed by a specific string n RegExp Quantifiers RegExp Object
185 ?!n Matches any string that is not followed by a specific string n RegExp Quantifiers RegExp Object
186 . Find a single character, except newline or line terminator RegExp Metacharacters RegExp Object
187 \w Find a word character RegExp Metacharacters RegExp Object
188 \W Find a non-word character RegExp Metacharacters RegExp Object
189 \d Find a digit RegExp Metacharacters RegExp Object
190 \D Find a non-digit character RegExp Metacharacters RegExp Object
191 \s Find a whitespace character RegExp Metacharacters RegExp Object
192 \S Find a non-whitespace character RegExp Metacharacters RegExp Object
193 \b Find a match at the beginning/end of a word, beginning like this: \bHI, end like this: HI\b RegExp Metacharacters RegExp Object
194 \B Find a match, but not at the beginning/end of a word RegExp Metacharacters RegExp Object
195 \0 Find a NUL character RegExp Metacharacters RegExp Object
196 \n Find a new line character RegExp Metacharacters RegExp Object
197 \f Find a form feed character RegExp Metacharacters RegExp Object
198 \r Find a carriage return character RegExp Metacharacters RegExp Object
199 \t Find a tab character RegExp Metacharacters RegExp Object
200 \v Find a vertical tab character RegExp Metacharacters RegExp Object
201 \xxx Find the character specified by an octal number xxx RegExp Metacharacters RegExp Object
202 \xdd Find the character specified by a hexadecimal number dd RegExp Metacharacters RegExp Object
203 \udddd Find the Unicode character specified by a hexadecimal number dddd RegExp Metacharacters RegExp Object
204 [abc] Find any character between the brackets RegExp Brackets RegExp Object
205 [^abc] Find any character NOT between the brackets RegExp Brackets RegExp Object
206 [0-9] Find any character between the brackets (any digit) RegExp Brackets RegExp Object
207 [^0-9] Find any character NOT between the brackets (any non-digit) RegExp Brackets RegExp Object
208 (x|y) Find any of the alternatives specified RegExp Brackets RegExp Object
209 g Perform a global match (find all matches rather than stopping after the first match) RegExp Modifiers RegExp Object
210 i Perform case-insensitive matching RegExp Modifiers RegExp Object
211 m Perform multiline matching RegExp Modifiers RegExp Object
212 break Exits a switch or a loop Statement Identifiers
213 const Declares a variable with a constant value Statement Identifiers
214 class Declares a class Statement Identifiers
215 continue Breaks one iteration (in the loop) if a specified condition occurs, and continues with the next iteration in the loop Statement Identifiers
216 debugger Stops the execution of JavaScript, and calls (if available) the debugging function Statement Identifiers
217 do ... while Executes a block of statements and repeats the block while a condition is true Statement Identifiers
218 for Loops through a block of code a number of times Statement Identifiers
219 for ... in Loops through the properties of an object Statement Identifiers
220 for ... of Loops through the values of an iterable object Statement Identifiers
221 function Declares a function Statement Identifiers
222 if ... else ... else if Marks a block of statements to be executed depending on a condition Statement Identifiers
223 let Declares a variable inside brackets {} scope Statement Identifiers
224 return Stops the execution of a function and returns a value from that function Statement Identifiers
225 switch Marks a block of statements to be executed depending on different cases Statement Identifiers
226 throw Throws (generates) an error Statement Identifiers
227 try ... catch ... finally Marks the block of statements to be executed when an error occurs in a try block, and implements error handling Statement Identifiers
228 var Declares a variable Statement Identifiers
229 while Marks a block of statements to be executed while a condition is true Statement Identifiers
230 anchor() Creates an anchor String HTML Wrapper Methods
231 big() Displays a string using a big font String HTML Wrapper Methods
232 blink() Displays a blinking string String HTML Wrapper Methods
233 bold() Displays a string in bold String HTML Wrapper Methods
234 fixed() Displays a string using a fixed-pitch font String HTML Wrapper Methods
235 fontcolor() Displays a string using a specified color String HTML Wrapper Methods
236 fontsize() Displays a string using a specified size String HTML Wrapper Methods
237 italics() Displays a string in italic String HTML Wrapper Methods
238 link() Displays a string as a hyperlink String HTML Wrapper Methods
239 small() Displays a string using a small font String HTML Wrapper Methods
240 strike() Displays a string with a strikethrough String HTML Wrapper Methods
241 sub() Displays a string as subscript text String HTML Wrapper Methods
242 sup() Displays a string as superscript text String HTML Wrapper Methods

JavaScript Arithmetic Operators

Operator Description Example Result in y Result in x Try it
+ Addition x = y + 2 y = 5 x = 7 Try it »
- Subtraction x = y - 2 y = 5 x = 3 Try it »
* Multiplication x = y * 2 y = 5 x = 10 Try it »
/ Division x = y / 2 y = 5 x = 2.5 Try it »
% Modulus (division remainder) x = y % 2 y = 5 x = 1 Try it »
++ Increment x = ++y y = 6 x = 6 Try it »
x = y++ y = 6 x = 5 Try it »
-- Decrement x = --y y = 4 x = 4 Try it »
x = y-- y = 4 x = 5 Try it »
JavaScript Assignment Operators
Operator Example Same As Result in x Try it
= x = y x = y x = 5 Try it »
+= x += y x = x + y x = 15 Try it »
-= x -= y x = x - y x = 5 Try it »
*= x *= y x = x * y x = 50 Try it »
/= x /= y x = x / y x = 2 Try it »
%= x %= y x = x % y x = 0 Try it »
JavaScript Bitwise Operators
Operator Description Example Same as Result Decimal
& AND x = 5 & 1 0101 & 0001 1 1
| OR x = 5 | 1 0101 | 0001 101 5
~ NOT x = ~ 5 ~0101 1010 10
^ XOR x = 5 ^ 1 0101 ^ 0001 100 4
<< Left shift x = 5 << 1 0101 << 1 1010 10
>> Right shift x = 5 >> 1 0101 >> 1 10 2
JavaScript Type Conversion
OriginalValue Convertedto Number Convertedto String Convertedto Boolean
0 0 "false" 0
1 1 "true" 1
0 0 "0" 0
1 1 "1" 1
"0" 0 "0" 1
"1" 1 "1" 1
NaN NaN "NaN" 0
Infinity Infinity "Infinity" 1
-Infinity -Infinity "-Infinity" 1
"" 0 "" 0
"20" 20 "20" 1
"twenty" NaN "twenty" 1
[ ] 0 "" 1
[20] 20 "20" 1
[10,20] NaN "10,20" 1
["twenty"] NaN "twenty" 1
["ten","twenty"] NaN "ten,twenty" 1
function(){} NaN "function(){}" 1
{ } NaN "[object Object]" 1
null 0 "null" 0
undefined NaN "undefined" 0