Advertisement
Crevice

Conditional Challenges 2

Nov 5th, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.35 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7.     <title>Document</title>
  8.     <script>
  9.         //#1
  10.         // declare 4 variables named value 1-5 (ex value1, value2, etc)
  11.         // assign them the following values in order 5, 15, 1, 100, and "5"
  12.  
  13.         //#2
  14.         //write an if condition that checks if value1 is less than value2. if true console log "value1 is smaller", otherwise, console log "value2 is smaller"
  15.  
  16.         //#3
  17.         //write an if condition that checks if value4 is greater than value2. If true console log "value4 is king", otherwise console log "value2 stands tall"
  18.  
  19.         //#4
  20.         //write an if condition with an "or" statement which checks whether value2 is less than 1 or greater than 100
  21.         //if either is true, console log "value2 is not within specified range"
  22.         //otherwise console log "value2 falls within specification"
  23.         //you must use your declared variables for this conditional, not just numbers!
  24.  
  25.         //#5
  26.         //write a conditional with an "and" statement which checks whether value2 is greater than or equal to value1 and
  27.         //also less than or equal to value4
  28.         //if true, console log that "the specified value satisfies both conditions"
  29.         //otherwise console log that "the specified value does not satisfy both conditions"
  30.  
  31.         //#6
  32.    //write a conditional that checks whether value1 and value5 are equal in value but not type
  33.         //if true, console log "the values are the same, but the types are different"
  34.         //otherwise, console log "the values or type might be different"
  35.  
  36.         //#7
  37.       //write a conditional that checks whether value1 and value5 have the same value and type
  38.         //if true, console log "strict comparisons check value and type"
  39.       //otherwise console log "the variables compared do not share identical values and types"
  40.  
  41.         //#8
  42.         //lastly, alter the values of your declared variables to alter which console logs run.
  43.         //Do multiple iterations of this until you have caused each console log to run
  44.         //Pay attention to what changes cause the different console logs to be logged in the console.
  45.     </script>
  46. </head>
  47. <body>
  48. </body>
  49. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement