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
JavaScript
(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 === {{Main|Structured programming}} JavaScript supports much of the [[structured programming]] syntax from [[C (computer language)|C]] (e.g., <code>if</code> statements, <code>while</code> loops, <code>switch</code> statements, <code>do while</code> loops, etc.). One partial exception is [[scope (computer science)|scoping]]: originally JavaScript only had [[function scoping]] with <code>var</code>; [[block scoping]] was added in ECMAScript 2015 with the keywords <code>let</code> and <code>[[const (computer programming)|const]]</code>. Like C, JavaScript makes a distinction between [[Expression (computer science)|expressions]] and [[Statement (computer science)|statements]]. One syntactic difference from C is [[Defensive semicolon|automatic semicolon insertion]], which allow semicolons (which terminate statements) to be omitted.<ref name="Flanagan2006">{{cite book|last=Flanagan|first=David|title=JavaScript: The Definitive Guide |url=https://books.google.com/books?id=2weL0iAfrEMC|date=August 17, 2006|publisher=[[O'Reilly Media, Inc.]]|isbn=978-0-596-55447-7|page=16|access-date=March 29, 2019|archive-date=August 1, 2020|archive-url=https://web.archive.org/web/20200801065235/https://books.google.com/books?id=2weL0iAfrEMC|url-status=live}}</ref>
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)