CINXE.COM
JavaScript Reserved Words
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="keywords" content="JavaScript Reserved Words, Java Keywords, ECMAScipt"> <meta name="Description" content="Javascript Reserved Words - avoid using reserved words and keywords as identifiers in your code. JavaScript has reserved these words for its own use."> <link rel="canonical" href="https://www.quackit.com/javascript/javascript_reserved_words.cfm"> <title>JavaScript Reserved Words</title> <script src="//ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <link rel="shortcut icon" href="/pix/favicon96.png"> <link rel="apple-touch-icon" href="/pix/apple-touch-icon.png"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet"> <link href="/common/css/master.45.min.css" rel="stylesheet"> <script async src="https://cdn.fuseplatform.net/publift/tags/2/3499/fuse.js"></script> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-Q3H025ZKLN"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-Q3H025ZKLN'); </script> </head> <body> <header class="site-header"> <div class="site-header-base"> <div class="site-logo"> <a title="Quackit Homepage" target="_top" href="/"><img src="/pix/quackit_logo_watermark.png" width="87" height="33" alt="Quackit Logo"></a> </div> <button id="site-nav-toggler" class="site-nav-toggler" aria-expanded="false" aria-controls="site-nav"> <span class="sr-only">Toggle navigation</span> ☰ </button> </div> <nav id="site-nav" class="site-nav"> <div class="site-links"> <ul> <li><a href="/"><i class="fa fa-home"></i> <span class="sr-only">Home</span></a></li> <li><a href="/html/">HTML</a></li> <li><a href="/css/">CSS</a></li> <li><a href="/scripting/">Scripting</a></li> <li><a href="/database/">Database</a></li> </ul> </div> <div class="site-search-top"> <form action="/search/" id="cse-search-box-bottom" class="site-search"> <div> <input type="hidden" name="cx" value="partner-pub-6331358926293806:98x0fk-bbgi"> <input type="hidden" name="cof" value="FORID:10"> <input type="hidden" name="ie" value="ISO-8859-1"> <input type="text" name="q" size="20" class="site-search-input"> <button type="submit" name="sa" class="site-search-button"><i class="fa fa-search"></i></button> </div> </form> </div> </nav> </header> <div class="main"> <article class="content"> <h1 class="page-title">JavaScript Reserved Words</h1> <div class="ad ad-top"> <!-- GAM 71161633/QCKIT_quackit/article_header --> <div data-fuse="23059883623"></div> </div> <p>You should avoid using these reserved words and keywords as function or variable names as <a href="/javascript/">JavaScript</a> has reserved these words for its own use.</p> <div class="ad"> <!-- GAM 71161633/QCKIT_quackit/article_incontent_1 --> <div data-fuse="23059883629"></div> </div> <table class="tabular col-3"> <tr> <th colspan="3">JavaScript Reserved Words</th> </tr> <tr> <td>break</td> <td>export</td> <td>return</td> </tr> <tr> <td>case</td> <td>for</td> <td>switch</td> </tr> <tr> <td>comment</td> <td>function</td> <td>this</td> </tr> <tr> <td>continue</td> <td>if</td> <td>typeof</td> </tr> <tr> <td>default</td> <td>import</td> <td>var</td> </tr> <tr> <td>delete</td> <td>in</td> <td>void</td> </tr> <tr> <td>do</td> <td>label</td> <td>while</td> </tr> <tr> <td>else</td> <td>new</td> <td>with</td> </tr> </table> <table class="tabular col-3"> <tr> <th colspan="3">Java Keywords (Reserved by JavaScript)</th> </tr> <tr> <td>abstract</td> <td>implements</td> <td>protected</td> </tr> <tr> <td>boolean</td> <td>instanceOf</td> <td>public</td> </tr> <tr> <td>byte</td> <td>int</td> <td>short</td> </tr> <tr> <td>char</td> <td>interface</td> <td>static</td> </tr> <tr> <td>double</td> <td>long</td> <td>synchronized</td> </tr> <tr> <td>false</td> <td>native</td> <td>throws</td> </tr> <tr> <td>final</td> <td>null</td> <td>transient</td> </tr> <tr> <td>float</td> <td>package</td> <td>true</td> </tr> <tr> <td>goto</td> <td>private</td> <td> </td> </tr> </table> <table class="tabular col-3"> <tr> <th colspan="3">ECMAScipt Reserved Words</th> </tr> <tr> <td>catch</td> <td>enum</td> <td>throw</td> </tr> <tr> <td>class</td> <td>extends</td> <td>try</td> </tr> <tr> <td>const</td> <td>finally</td> <td> </td> </tr> <tr> <td>debugger</td> <td>super</td> <td> </td> </tr> </table> <table class="tabular col-3"> <tr> <th colspan="3">Other JavaScript Keywords</th> </tr> <tr> <td>alert</td> <td>isFinite</td> <td>personalbar</td> </tr> <tr> <td>Anchor</td> <td>isNan</td> <td>Plugin</td> </tr> <tr> <td>Area</td> <td>java</td> <td>print</td> </tr> <tr> <td>arguments</td> <td>JavaArray</td> <td>prompt</td> </tr> <tr> <td>Array</td> <td>JavaClass</td> <td>prototype</td> </tr> <tr> <td>assign</td> <td>JavaObject</td> <td>Radio</td> </tr> <tr> <td>blur</td> <td>JavaPackage</td> <td>ref</td> </tr> <tr> <td>Boolean</td> <td>length</td> <td>RegExp</td> </tr> <tr> <td>Button</td> <td>Link</td> <td>releaseEvents</td> </tr> <tr> <td>callee</td> <td>location</td> <td>Reset</td> </tr> <tr> <td>caller</td> <td>Location</td> <td>resizeBy</td> </tr> <tr> <td>captureEvents</td> <td>locationbar</td> <td>resizeTo</td> </tr> <tr> <td>Checkbox</td> <td>Math</td> <td>routeEvent</td> </tr> <tr> <td>clearInterval</td> <td>menubar</td> <td>scroll</td> </tr> <tr> <td>clearTimeout</td> <td>MimeType</td> <td>scrollbars</td> </tr> <tr> <td>close</td> <td>moveBy</td> <td>scrollBy</td> </tr> <tr> <td>closed</td> <td>moveTo</td> <td>scrollTo</td> </tr> <tr> <td>confirm</td> <td>name</td> <td>Select</td> </tr> <tr> <td>constructor</td> <td>NaN</td> <td>self</td> </tr> <tr> <td>Date</td> <td>navigate</td> <td>setInterval</td> </tr> <tr> <td>defaultStatus</td> <td>navigator</td> <td>setTimeout</td> </tr> <tr> <td>document</td> <td>Navigator</td> <td>status</td> </tr> <tr> <td>Document</td> <td>netscape</td> <td>statusbar</td> </tr> <tr> <td>Element</td> <td>Number</td> <td>stop</td> </tr> <tr> <td>escape</td> <td>Object</td> <td>String</td> </tr> <tr> <td>eval</td> <td>onBlur</td> <td>Submit</td> </tr> <tr> <td>FileUpload</td> <td>onError</td> <td>sun</td> </tr> <tr> <td>find</td> <td>onFocus</td> <td>taint</td> </tr> <tr> <td>focus</td> <td>onLoad</td> <td>Text</td> </tr> <tr> <td>Form</td> <td>onUnload</td> <td>Textarea</td> </tr> <tr> <td>Frame</td> <td>open</td> <td>toolbar</td> </tr> <tr> <td>Frames</td> <td>opener</td> <td>top</td> </tr> <tr> <td>Function</td> <td>Option</td> <td>toString</td> </tr> <tr> <td>getClass</td> <td>outerHeight</td> <td>unescape</td> </tr> <tr> <td>Hidden</td> <td>OuterWidth</td> <td>untaint</td> </tr> <tr> <td>history</td> <td>Packages</td> <td>unwatch</td> </tr> <tr> <td>History</td> <td>pageXoffset</td> <td>valueOf</td> </tr> <tr> <td>home</td> <td>pageYoffset</td> <td>watch</td> </tr> <tr> <td>Image</td> <td>parent</td> <td>window</td> </tr> <tr> <td>Infinity</td> <td>parseFloat</td> <td>Window</td> </tr> <tr> <td>InnerHeight</td> <td>parseInt</td> <td> </td> </tr> <tr> <td>InnerWidth</td> <td>Password</td> <td> </td> </tr> </table> </article> <div class="sidebar"> <nav> <ul> <li> <h3><a href="/javascript/tutorial/">JavaScript Tutorial</a></h3> <ul> <li><a href="/javascript/tutorial/introduction.cfm">Introduction</a></li> <li><a href="/javascript/tutorial/how_to_enable_javascript.cfm">How to Enable JavaScript</a></li> <li><a href="/javascript/tutorial/javascript_syntax.cfm">JavaScript Syntax</a></li> <li><a href="/javascript/tutorial/javascript_popup_boxes.cfm">JavaScript Popup Boxes</a></li> <li><a href="/javascript/tutorial/javascript_html.cfm">JavaScript and HTML</a></li> <li><a href="/javascript/tutorial/external_javascript_file.cfm">External JavaScript File</a></li> <li><a href="/javascript/tutorial/javascript_operators.cfm">JavaScript Operators</a></li> <li><a href="/javascript/tutorial/javascript_variables.cfm">JavaScript Variables</a></li> <li><a href="/javascript/tutorial/javascript_functions.cfm">JavaScript Functions</a></li> <li><a href="/javascript/tutorial/javascript_events.cfm">JavaScript Events</a></li> <li><a href="/javascript/tutorial/javascript_if_statements.cfm">JavaScript If Statements</a></li> <li><a href="/javascript/tutorial/javascript_switch_statement.cfm">JavaScript Switch Statements</a></li> <li><a href="/javascript/tutorial/javascript_while_loop.cfm">JavaScript While Loop</a></li> <li><a href="/javascript/tutorial/javascript_for_loop.cfm">JavaScript For Loop</a></li> <li><a href="/javascript/tutorial/javascript_try_catch.cfm">JavaScript Try Catch</a></li> <li><a href="/javascript/tutorial/javascript_escape_characters.cfm">JavaScript Escape Characters</a></li> <li><a href="/javascript/tutorial/javascript_void_0.cfm">JavaScript Void(0)</a></li> <li><a href="/javascript/tutorial/javascript_cookies.cfm">JavaScript Cookies</a></li> <li><a href="/javascript/tutorial/javascript_date_and_time.cfm">JavaScript Date and Time</a></li> <li><a href="/javascript/tutorial/javascript_arrays.cfm">JavaScript Arrays</a></li> <li><a href="/javascript/tutorial/two_dimensional_arrays.cfm">Two Dimensional Arrays</a></li> <li><a href="/javascript/tutorial/innerhtml_in_javascript.cfm">JavaScript innerHTML</a></li> <li><a href="/javascript/tutorial/unobtrusive_javascript.cfm">Unobtrusive JavaScript</a></li> <li><a href="/javascript/tutorial/javascript_summary.cfm">JavaScript Summary</a></li> </ul> </li> <li><h3>JavaScript Reference</h3> <ul> <li><a href="/javascript/examples/" title="">JavaScript Examples</a></li> <li><a href="/javascript/javascript_reserved_words.cfm" title="">JavaScript Reserved Words</a></li> <li><a href="/javascript/javascript_event_handlers.cfm" title="Introduction to the 12 JavaScript event handlers">JavaScript Event Handlers</a></li> <li><a href="/javascript/javascript_date_and_time_functions.cfm" title="Full listing of all JavaScript methods for dealing with date and time.">JavaScript Date and Time Functions</a></li> </ul> <li><h3>jQuery</h3> <ul> <li><a href="/jquery/tutorial/" title="">jQuery Tutorial</a></li> <li><a href="/jquery/examples/" title="">jQuery Examples</a></li> </ul> </li> <li><h3>JSON</h3> <ul> <li><a href="/json/tutorial/" title="Data format for exchanging data between applications and different environments.">JSON Tutorial</a></li> </ul> <li> </ul> </nav> <div class="ad ad-left"> <!-- GAM 71161633/QCKIT_quackit/article_vrec_2 --> <div data-fuse="23059511712"></div> </div> </div> <div class="ads"> <div class="ad ad-right"> <!-- GAM 71161633/QCKIT_quackit/article_vrec_1 --> <div data-fuse="23059883626"></div> </div> </div> </div> <div class="searchbox-bottom"> <form action="/search/" id="cse-search-box-bottom" class="site-search"> <div> <input type="hidden" name="cx" value="partner-pub-6331358926293806:npmuvy-i8kk"> <input type="hidden" name="cof" value="FORID:10"> <input type="hidden" name="ie" value="ISO-8859-1"> <input type="text" name="q" size="30" class="site-search-input"> <button type="submit" name="sa" class="site-search-button"><i class="fa fa-search"></i></button> </div> </form> <script src="//cse.google.com/cse/brand?form=cse-search-box-bottom&lang=en"></script> </div> <footer> <p class="about"><a href="/"><i class="fa fa-home"></i> Home</a> | <a href="/about.cfm" rel="nofollow">About</a> | <a href="/contact.cfm" rel="nofollow">Contact</a> | <a href="/terms_of_use.cfm" rel="nofollow">Terms of Use</a> | <a href="/privacy_policy.cfm" rel="nofollow">Privacy Policy</a></p> <p>© Copyright 2000 - 2024 Quackit.com </p> </footer> <script src="/common/js/spectrum/spectrum.js"></script> <script src="/common/js/lightbox2-master/dist/js/lightbox.min.js" charset="utf-8"></script> <script> $(document).ready(function(){ $( "#site-nav-toggler" ).click(function() { $( "#site-nav" ).toggle( "slow" ); }); }); </script> <script> $(function(){var a=window.location.href;$(".sidebar nav a").each(function(){a==this.href&&$(this).closest("li").addClass("selected")})}); </script> </body> </html>