So, today is 7th Feb - The Rose Day
Yesterday night only, I planned to gift my loved one JS-JavaScript a red rose to signify my love to her, so I planned that I woke up early at morning before 5 am and since there is no park nearby to my home,so I decided to take a long walk and go to park and pick a rose from there.
Let me tell you one thing about my lover JS, she is too sensitive , in her terms Case -sensitive . Don't tell her that I told you this , otherwise she will act weird with me and that's also a thing about her.
We will discuss that later . Coming back to case-sensitivity , It simply means letter "A" and letter "a" is different while reading to my lover and since I already decided to think in her language only , during the Valentine week , so I have to think,write and code in her language only.Oh boy!that will be a huge task, so all leaving aside,I slept at night and wake up at 5am today succesfully. But wait what I see through a window thats there is a fog outside.
checking if there is no fog outside(so my condition here is to check that there must be no fog outside and if this returns true then only i will go at 5am otherwise(means it is false,that is still its foggy outside) i will go at 6am.
let isFog = true;
let willGoAt;
if (!isFog) {
willGoAt = "5 am";
} else {
willGoAt = "6 am";
}
console.log("I will go to park at " + willGoAt);
I will go to park at 6 am
One thing , you can notice I have used some "special word(keyword)" (in my JS lover term, that's a variable") like "let" above, there was something var and const also in my js lover dictionary to declare a variable but I used let here since fog can be gone after some time and
that time I can reassign isFog to false,if I choose it like this const isFog = true
then it can't be reassigned to false means there will be fog always outside and that i think nobody wants , at least I dont want. But wait, let me complete the Rose day story first, as I told you I have a full plan for this Valentine Week , I will share the variables on another day.Stay Tuned for that.
Coming back to this, since its about my JS lover, so I decided to make my conditions more further extended,
I thought to check that fogCondition and even if its not true then further i can see whether i have hoody with me,if i have that i can go at 5.30 am even if there is a fog and if i don't have that one then willGoAt 6 am only. So now, my thoughts into my JS lover terms will be written like this.
let isFog = true;
let willGoAt;
let isHoodieAvailable = false;
if (!isFog) {
willGoAt = "5 am";
} else if(isHoodieAvailable){
willGoAt = "5:30 am";
} else {
willGoAt = "6 am";
}
console.log("I will go to park at " + willGoAt);
I will go to park at 6 am
But being, being me, I thought why not add another condition and shift the timing to 8am since there was a chance that my hoodie will also not be available since it was roaming around in washing machine only from so many days,Oh no, I have given this information to you also,No way.Ok,leave that, coming back to our extended condition.
so I will check isSunRise and if that's true I will go at 6 am otherwise in any condition (i.e. whether there will be fog and even noHoddieAvailable and even noSunRise),I will go at 8am. So now, my thoughts into my JS lover terms will be written like this.
let isFog = true; let willGoAt; let isHoodieAvailable = false; let isSunRise = false; if (!isFog) { willGoAt = "5 am"; } else if (isHoodieAvailable){ willGoAt = "5:30 am"; } else if (isSunRise){ willGoAt = "6 am"; } else { willGoAt = "8 am"; } console.log("I will go to park at " + willGoAt);
I will go to park at 8 am
And you know what , today while sharing this with you at "7 pm" and still I didn't bought rose for my Js lover because I put one more condition , this time in my mind only like this.I introduced one more condition to check whether the rose idea can be dropped out or not , what is the feasibility in dropping out and if i changed the statements look like this.
let isFog = true;
let willGoAt;
let isHoodieAvailable = false;
let isSunRise = false;
let isRoseIdeaDroppedOut = true;
if (!isFog) {
willGoAt = "5 am";
} else if (isHoodieAvailable){
willGoAt = "5:30 am";
} else if (isSunRise){
willGoAt = "6 am";
} else if(!isRoseIdeaDroppedOut) {
willGoAt = "8 am";
} else {
console.log("Hey! JS you are my lover.");
console.log("You yourself is a rose, who gifts another rose to a rose.");
console.log("That's why I didn't bought a rose for you.Happy Rose Day!!");
}
Hey! JS you are my lover. You yourself is a rose, who gifts another rose to a rose. That's why I didn't bought a rose for you.Happy Rose Day!!
Hey Wait!There is something new in the story which is yet to be shared, I have n't shared my lover JS thoughts on it. She told me tomorrow is Feb 8th - Propose Day and she will take the action and she stated ''you are too good, you have used if statements ,else if statements , else statements according to me only to express your feelings, I am impressed but wait let me show you one more way to express my feeling to you". By the way here you referred to me only, don't blush while reading. Coming back to point, she written conditional statement this way.
let jswakeUpAt = "8:00AM";
switch (jswakeUpAt) {
case "6:00AM":
console.log("Will go to park at 6:00AM");
break;
case "6:30AM":
console.log("Will go to park at 6:30AM");
break;
case "7:00AM":
console.log("Will go to park at 7:00AM");
break;
case "7:30AM":
console.log("Will go to park at 7:30AM");
break;
default:
console.log("Will go to park at 8:00AM");
}
console.log("I will go to park at " + willGoAt);
My lover Js played master stroke here, let's wait for tomorrow Feb 8th - Propose Day. Don't worry I will be posting the article here for all of you curious minds who will be thinking now what gonna happen. I don't know exactly what she planning for tomorrow but being a js lover, I have a hint that tomorrow will be a Loop Day!