Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>Document</title>
- <script>
- //#1
- // declare 4 variables named value 1-5 (ex value1, value2, etc)
- // assign them the following values in order 5, 15, 1, 100, and "5"
- //#2
- //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"
- //#3
- //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"
- //#4
- //write an if condition with an "or" statement which checks whether value2 is less than 1 or greater than 100
- //if either is true, console log "value2 is not within specified range"
- //otherwise console log "value2 falls within specification"
- //you must use your declared variables for this conditional, not just numbers!
- //#5
- //write a conditional with an "and" statement which checks whether value2 is greater than or equal to value1 and
- //also less than or equal to value4
- //if true, console log that "the specified value satisfies both conditions"
- //otherwise console log that "the specified value does not satisfy both conditions"
- //#6
- //write a conditional that checks whether value1 and value5 are equal in value but not type
- //if true, console log "the values are the same, but the types are different"
- //otherwise, console log "the values or type might be different"
- //#7
- //write a conditional that checks whether value1 and value5 have the same value and type
- //if true, console log "strict comparisons check value and type"
- //otherwise console log "the variables compared do not share identical values and types"
- //#8
- //lastly, alter the values of your declared variables to alter which console logs run.
- //Do multiple iterations of this until you have caused each console log to run
- //Pay attention to what changes cause the different console logs to be logged in the console.
- </script>
- </head>
- <body>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement