- JavaScript Basics
- JavaScript Home
- JavaScript Syntax
- JavaScript Placements
- JavaScript Output
- JavaScript Statements
- JavaScript Keywords
- JavaScript Comments
- JavaScript Variables
- JavaScript var
- JavaScript let
- JavaScript const
- JavaScript var Vs let Vs const
- JavaScript Operators
- JavaScript Comparison/Logical
- JavaScript Data Types
- JS Conditional Statements
- JavaScript Conditional Statement
- JavaScript if Statement
- JavaScript if-else Statement
- JavaScript switch Statement
- JavaScript Loops
- JavaScript for Loop
- JavaScript while Loop
- JavaScript do-while Loop
- JavaScript Break Continue
- JavaScript Popup Boxes
- JavaScript Dialog Box
- JavaScript alert Box
- JavaScript confirm Box
- JavaScript prompt Box
- JavaScript Functions
- JavaScript Functions
- JS Function with Parameter
- JavaScript Return Statement
- JavaScript Variable Scope
- JavaScript setTimeout() Method
- JavaScript setInterval() Method
- JavaScript Events
- JavaScript Events
- JavaScript onclick Event
- JavaScript onload Event
- JavaScript Mouse Events
- JavaScript onreset Event
- JavaScript onsubmit Event
- JavaScript Objects
- JavaScript Objects
- JavaScript Number Object
- JavaScript Array Object
- JavaScript String Object
- JavaScript Boolean Object
- JavaScript Math Object
- JavaScript RegExp Object
- JavaScript Date Object
- JavaScript Browser Objects
- JavaScript Browser Objects
- JavaScript Window Object
- JavaScript Navigator Object
- JavaScript History Object
- JavaScript Screen Object
- JavaScript Location Object
- JavaScript Document Object
- JS Document Object Collection
- JS Document Object Properties
- JS Document Object Methods
- JS Document Object with Forms
- JavaScript DOM
- JavaScript DOM
- JavaScript DOM Nodes
- JavaScript DOM Levels
- JavaScript DOM Interfaces
- JavaScript Cookies
- JavaScript Cookies
- JavaScript Create/Delete Cookies
- JavaScript Advance
- JavaScript Regular Expression
- JavaScript Page Redirection
- JavaScript Form Validation
- JavaScript Validations
- JavaScript Error Handling
- JavaScript Exception Handling
- JavaScript try-catch throw finally
- JavaScript onerror Event
- JavaScript Multimedia
- JavaScript Animation
- JavaScript Image Map
- JavaScript Debugging
- JavaScript Browser Detection
- JavaScript Security
- JavaScript Misc
- JavaScript innerHTML
- JavaScript getElementById()
- JS getElementsByClassName()
- JS getElementsByName()
- JS getElementsByTagName()
- JavaScript querySelector()
- JavaScript querySelectorAll()
- JavaScript document.write()
- JavaScript console.log()
- JavaScript Programs
- JavaScript Programs
- JavaScript Test
- JavaScript Online Test
- Give Online Test
- All Test List
JavaScript Keywords
In JavaScript, a keyword is a reserved word define by the JavaScript developer, with its pre-defined meaning. For example:
HTML with JavaScript Code
<!DOCTYPE html> <html> <body> <script> var x = 10; if(x == 0) { document.write("The value of 'x' is equal to 0.") } else if(x > 0) { document.write("The value of 'x' is a positive number."); } else { document.write("The value of 'x' is a negative number."); } </script> </body> </html>
Output
In above example, the var, if, and else are keywords. The var is used to declare a variable. The if is used when we need to execute some block of code, when the specified condition evaluates to be true. The else is the counter-part of if.
Note - Do not use any keyword as an identifier. If you do so, then that word acts the way, it is defined by the developer. So avoid using any keyword listed in this article.
List of All Keywords in JavaScript
Here are the list of all keywords available in JavaScript:
- alert
- anchor
- anchors
- area
- arguments
- array
- assign
- await
- blur
- break
- button
- case
- catch
- checkbox
- class
- clearinterval
- cleartimeout
- clientinformation
- close
- closed
- confirm
- const
- constructor
- continue
- crypto
- date
- debugger
- decodeuri
- decodeuricomponent
- default
- defaultstatus
- delete
- do
- document
- element
- elements
- else
- embed
- embeds
- encodeuri
- encodeuricomponent
- enum
- escape
- eval
- eval
- event
- export
- extends
- false
- fileupload
- finally
- focus
- for
- form
- forms
- frame
- framerate
- frames
- function
- function
- getclass
- hasownproperty
- hidden
- history
- if
- image
- images
- implements
- import
- in
- infinity
- innerheight
- innerwidth
- instanceof
- interface
- isfinite
- isnan
- isprototypeof
- java
- javaarray
- javaclass
- javaobject
- javapackage
- layer
- layers
- length
- let
- link
- location
- math
- mimetypes
- name
- nan
- navigate
- navigator
- new
- null
- number
- object
- offscreenbuffering
- onblur
- onclick
- onerror
- onfocus
- onkeydown
- onkeypress
- onkeyup
- onmouseover
- onload
- onmouseup
- onmousedown
- onsubmit
- open
- opener
- option
- outerheight
- outerwidth
- package
- packages
- pagexoffset
- pageyoffset
- parent
- parsefloat
- parseint
- password
- pkcs11
- plugin
- private
- prompt
- propertyisenum
- protected
- prototype
- public
- radio
- reset
- return
- screenx
- screeny
- scroll
- secure
- select
- self
- setinterval
- settimeout
- static
- status
- string
- submit
- super
- switch
- taint
- text
- textarea
- this
- throw
- top
- tostring
- true
- try
- typeof
- undefined
- unescape
- untaint
- valueof
- var
- void
- while
- window
- with
- yield
« Previous Tutorial Next Tutorial »