Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
ECMAScript
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Imperative and structured === ECMAScript JavaScript<!-- How to make clearer? --> supports [[C (programming language)|C]]-style structured programming. Previously, JavaScript only supported [[Scope (computer science)|function scoping]] using the keyword <code>var</code>, but ECMAScript 2015 added the keywords <code>let</code> and <code>const</code>, allowing JavaScript to support both block scoping and function scoping. JavaScript supports [[automatic semicolon insertion]], meaning that semicolons that normally terminate a statement in C may be omitted in JavaScript.<!-- Might imply EMCAScript doesn't support automatic semicolon insertion --><ref name="Flanagan2006">{{cite book|title=JavaScript: The Definitive Guide|first=David|last=Flanagan|edition=5th|date=17 August 2006|publisher=O'Reilly|isbn=978-0-596-10199-2|page=16|url=https://archive.org/details/javascriptdefini0000flan|url-access=registration}}</ref> Like C-style languages, [[control flow]] is done with the {{Code|code=while}}, {{Code|code=for}}, {{Code|code=do}} / {{Code|code=while}}, {{Code|code=if}} / {{Code|code=else}}, and {{Code|code=switch}} statements.<!-- missing Labels / Functions --> Functions are weakly typed and may accept and return any type. Arguments not provided default to {{Code|code=undefined}}.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)