FOR LOOPS WITH IF and ELSE (Javascript tutorial #12)

in blurtutorials •  4 years ago  (edited)

Below code we have done some changes compared to last tutorial , so first of all make sure to attend that before reading here

images_20201019000258360.jpg

So we have already learned about for loops and if else statements so let's use both of them together to make something interesting.

So without wasting anytime , lets get started.

Step 1 : create a html structure just like all the other tutorials.

Step 2 : Create following script tag and write the code as it is.

Screenshot from 2020-10-18 23-53-26.png

Step 3 : Run your file with the browser and press F12 to see the result.

Screenshot from 2020-10-18 23-53-22.png

Full Code :

Screenshot from 2020-10-18 23-53-27.png

Further Explanation :
In this we have created a new Array i.e totalblurtpower that corresponds to the value of blurt power present in @double-u , @sct.blurt , @looking.

So for each condition of for loop a if else condition is also used where the totalblurtpower of @double-u , @sct.blurt and @looking are checked if it is greater than 1000000.

If yes than we see on console that the person has less than or more than 1M Blurtpower in with him.

So thats all about the tutorial today.

Thank You.


Links to all the tutorials are shared below

  1. Javascript , Alert Message
  2. Lets Play with buttons Using Javascript
  3. How To Change Html content using Javascript
  4. Data Types And Variable in Javascript #1
  5. SWAPPING TECHNIQUE IN JAVASCRIPT
  6. OBJECTS IN JAVASCRIPT #1
  7. OBJECTS IN JAVASCRIPT #2
  8. OBJECTS IN JAVASCRIPT #3
  9. ARRAYS IN JAVASCRIPT #1
  10. If and Else Statements in Javascript
  11. FOR LOOPS IN JAVASCRIPT
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE BLURT!
Sort Order:  
  ·  4 years ago  ·  

Great tutorial.

  ·  4 years ago  ·  

hello friend, a question, what languages should be mastered to be a blockchain developer like you? greetings and good tutorials you have here, maybe start showing how they use python in clear Spanish, greetings

I am also learning at the moment.
but there are varieties of languages that can be mastered to become a Blockchain developer like JavaScript , Solidity and Smart Contracts in it.

Congratulations! This post has been upvoted by the @blurtcurator communal account,
You can request a vote every 12 hours from the #getupvote channel in the official Blurt Discord.Don't wait to join ,lots of good stuff happening there.