Story cover for Control Flow in JavaScript by mahesh1439
Control Flow in JavaScript
  • WpView
    Reads 1
  • WpVote
    Votes 0
  • WpPart
    Parts 1
  • WpHistory
    Time <5 mins
  • WpView
    Reads 1
  • WpVote
    Votes 0
  • WpPart
    Parts 1
  • WpHistory
    Time <5 mins
Ongoing, First published May 03, 2024
Control flow in JavaScript is a fundamental concept that dictates the order in which statements are executed within a script. It enables developers to control the flow of program execution based on conditions and loops. Understanding control flow is essential for writing efficient and logic-driven JavaScript code.

Conditional Statements

Conditional statements allow developers to execute code based on specific conditions. JavaScript provides several types of conditional statements:

if statement: This statement evaluates a condition and executes a block of code if the condition is true. For example:

if (condition) {
    // Code block to execute if condition is true
}

if...else statement: It executes one block of code if a condition is true and another block if the condition is false. Example:

if (condition) {
    // Code block to execute if condition is true
} else {
    // Code block to execute if condition is false
}

else if statement: This statement allows for multiple conditions to be checked sequentially. Example:

if (condition1) {
    // Code block to execute if condition1 is true
} else if (condition2) {
    // Code block to execute if condition2 is true
} else {
    // Code block to execute if neither condition1 nor condition2 is true
}
switch statement: It evaluates an expression and executes code based on a matching case label. Example:

switch (expression) {
    case value1:
        // Code block to execute if expression equals value1
        break;
    case value2:
        // Code block to execute if expression equals value2
        break;
    default:
        // Code block to execute if expression doesn't match any case
}

Loops

Loops are used to execute a block of code repeatedly until a specified condition is met. JavaScript supports different types of loops:

for loop: Executes a block of code a specified number of times. Example:

for (initialization; condition; iteration) {
    // Code block to execute
All Rights Reserved
Sign up to add Control Flow in JavaScript to your library and receive updates
or
Content Guidelines
You may also like
Vowels Of Raghuvanshi's by meowislazy
35 parts Ongoing
"Viki, please, don't do this to me. You're hurting me" "Adu, please, trust me, I would never do that" _____________________________________ "Agastya, please save my baby, you know how much I love her. I beg you, I won't do any mischief, I will do everything you say, but please save our kid" "Ayesh, book!!! Ayesh, calm down. What are you doing? I will save our baby." _____________________________________ "Ahaan, I've given 3 chances still you want me to be a sensible person. I never wanted to take her away from you. I wanted her to experience love" "Please, Isha! I know I made a big mistake. I was crying everyday. Regretting everytime I've done to you" _____________________________________ "Ayaan, please. I love you!! Don't leave me. I know I made mistakes in the past but I want to forget everything and start a new life with you" "Urina, I'm giving you 2 days, do whatever you want but make me impressed by you. I've always loved you but something was stopping me, but now nothing's gonna separate us" _____________________________________ Hey everyone, okay so let me start by introducing myself:- • I am Ashka • I am a student • I just thought of taking my feelings out because there was no one to listen there's two person who can do that but I just have some trust issues so I just thought of representing my thoughts as a story to some people. Okay? So now 8 hearts, 4 couples, 2 family, 4 brothers, 4 sisters. Let's see how these 8 hearts are gonna get back on their track. Lights, camera and action📷.
PRERISH TS: Ishq mein marjawan... by kavyanjali08
5 parts Complete Mature
"Iss ishq mein marjawan Kuch bhi kasam se karjawan Hadh se bhi guzarjawan Kuch bhi kasam se karjawan " He puts forward the proposal of marriage to give his daughter a mother, She accepts the proposal as a deal to save the man she loves, The equation of their marriage is simple in which love wasn't even a factor between them and they were fine with their marriage being of convenience. But suddenly their simple equation changes into complicated one when unbeknownst he starting to having feelings for her. While a incident changes her perspective too making her realize that everything isn't same as before... The man she loved has changed so much that she doesn't recognize him while her husband isn't as she thought him to be. Learning the hard way she starts to try and understand the enigma that her husband is... finding herself getting enamored by him... He decides to win his love and for that he is ready to anything because his love has no limits for her. Ready to extract his revenge by finding a way around his promise because it has become more personal than ever, if such a thing was even possible... While she decides that no matter what the circumstance have been, it was time to let go off the chains of past because they have no place in her present or future. Hard and painful might it be but she was ready to find new roads in her life... Lastly, he is ready to do anything to have her back by his side and for that he has to rescue her from the clutches of the Devil which is easier said than done but now he was ready risk whatever it takes to win... To save the love of his life and his family... Three lives are going to change with their decisions, game of love is being played to win hearts, along with mind games to leave the heads reeling... Who is going to win this love-game? And who is going to get trapped in the maze of mind-games? Stakes are high and even higher risks are taken to win in this race... let the chase begin!
I Can't Let You Go (COMPLETED) by Miss_dreamy_writer
31 parts Complete Mature
#1 - Muslim | 16-11-2024 #1 - Urdu | 11-11-2024 #2 - Desi | 16-11-2024 #3 - Strong Female Lead | 16-11-2024 #4 - Replaced Bride | 30-10-2024 #8 - Love Life | 11-11-2024 #36 - Happily Ever After | 27-10-2024 #14 - Family Issues | 31-03-2025 #75 - Muslim Love Story | 3-10-2024 *** I stormed towards him, anger blurring my sights. The moment I was in front of him, I grabbed hold of his collar with my both hands. As I yell, "Are you cheating on me, Shahzain?" Seems like I took him by surprise, it took him a whole minute to realize what was happening right now. And the moment he did, he loosen my hold on him and pushed me, which had me stumbling back. "Even if I do, it shouldn't matter. I was forced into this marriage, Sobia." He yells back. "I didn't have a choice. But you had. You shouldn't have agreed to this marriage." Only if he knew, all my life it wasn't me who got to select the choice. Neither is this one, the most important one in my life. "I won't tolerate this. Either you leave me or leave her." I stated, anger clouding my senses. He walked towards me and took a hold of my chin in his hand and stated clearly. "And where's the fun in that? You ruined my life. I promised to ruin you till death do us a part." I pushed him hard. I had already suffered much from my so-called family. And I refused to get suffered by my husband. It's all about the limit. The moment I had my limit of misery and pain, I will end all of this. "Are you sure, it's not the other way around?" A humorless chuckle escapes my lips, as my darkest shade of eyes met his grey ones. "Also, just wanted to correct you, my dearest husband. You can't ruin what's already ruined, Shahzain." "And if I find out that you kept meeting her behind my back. I will ruin you and that lover of yours." With that I stormed out of our room, making up my mind.
You may also like
Slide 1 of 8
Vowels Of Raghuvanshi's cover
PRERISH TS: Ishq mein marjawan... cover
I Will Be The Strongest!! cover
Overtook Love|✔️ cover
I Can't Let You Go (COMPLETED) cover
Tangled ✓ cover
OCCULT VISION {COMPLETED} ✔️✔️ cover
OLD VERSION ✾Balance✾ (Lloyd Garmadon x Fem!Reader) cover

Vowels Of Raghuvanshi's

35 parts Ongoing

"Viki, please, don't do this to me. You're hurting me" "Adu, please, trust me, I would never do that" _____________________________________ "Agastya, please save my baby, you know how much I love her. I beg you, I won't do any mischief, I will do everything you say, but please save our kid" "Ayesh, book!!! Ayesh, calm down. What are you doing? I will save our baby." _____________________________________ "Ahaan, I've given 3 chances still you want me to be a sensible person. I never wanted to take her away from you. I wanted her to experience love" "Please, Isha! I know I made a big mistake. I was crying everyday. Regretting everytime I've done to you" _____________________________________ "Ayaan, please. I love you!! Don't leave me. I know I made mistakes in the past but I want to forget everything and start a new life with you" "Urina, I'm giving you 2 days, do whatever you want but make me impressed by you. I've always loved you but something was stopping me, but now nothing's gonna separate us" _____________________________________ Hey everyone, okay so let me start by introducing myself:- • I am Ashka • I am a student • I just thought of taking my feelings out because there was no one to listen there's two person who can do that but I just have some trust issues so I just thought of representing my thoughts as a story to some people. Okay? So now 8 hearts, 4 couples, 2 family, 4 brothers, 4 sisters. Let's see how these 8 hearts are gonna get back on their track. Lights, camera and action📷.