top of page

Task 1: Using the logical && operator

  • Writer: satyanarayan behera
    satyanarayan behera
  • Aug 25, 2022
  • 1 min read

You are coding an RPG game, where each character has certain skill levels based on the value saved in their score.

  1. Create a variable named score and set it to 8

  2. Use console.log() that includes the string "Mid-level skills:" and compares the score variable to above 0 and below 10 using the && operator

The expected output in the console should be: "Mid-level skills: true".

var score =8;

console.log("Mid-level skills: ",score>0 && score<10);


Recent Posts

See All
For Loop : Task 1

Write a "for" loop that will perform exactly the same repetitive code as this: console.log(1) console.log(2) console.log(3)...

 
 
 

Comments


  • alt.text.label.LinkedIn

©2022 by Satya

bottom of page