Anonymous
Not logged in
Talk
Contributions
Create account
Log in
WikiKnowledgeBase
Search
Editing
Technology/Software Development/Web development/JavaScript
(section)
From WikiKnowledgeBase
Namespaces
Page
Discussion
More
More
Page actions
Read
Edit
History
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!
== Control Structures == Control structures allow you to control the flow of execution in your JavaScript code. The most common control structures are: * '''if''' statement: Executes a block of code if a specified condition is true. For example: let age = 18; if (age >= 18) { console.log('You are an adult.'); } else { console.log('You are a minor.'); } * '''for''' loop: Repeats a block of code a certain number of times. For example: for (let i = 0; i < 5; i++) { console.log(i); } * '''while''' loop: Repeats a block of code as long as a specified condition is true. For example: let i = 0; while (i < 5) { console.log(i); i++; }
Summary:
Please note that all contributions to WikiKnowledgeBase may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
My wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation
Navigation
Main page
Random page
Categories
Help about MediaWiki
Wiki tools
Wiki tools
Special pages
Page tools
Page tools
User page tools
More
What links here
Related changes
Page information
Page logs