@cheshireoctopus/

FEWD: Conditional Statements + Logical Operators

JavaScript

No description

fork
loading

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.4224999768292841","path":"main.js","file":{"path":"main.js","content":{"asEncoding":{"base64":"Ly8gSW5zdHJ1Y3Rpb25zOgovLyBXcml0ZSB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnMgc28gdGhhdCAnUHJpbnQgdGhpcyEnIGFwcGVhcnMgdGhyZWUgdGltZXMgaW4gdGhlIGNvbnNvbGUKLy8gVXNlIHRoZSBmb2xsb3dpbmcgdmFyaWFibGUgd2hlbiB3cml0aW5nOgp2YXIgeCA9IDEwCgovLyAxLiBVc2UgYSA8IG9yIGEgPiAobGVzcyB0aGFuLCBvciBncmVhdGVyIHRoYW4pIG9wZXJhdG9yCmlmICh4ID4gOCkgewoJY29uc29sZS5sb2coJ1ByaW50IHRoaXMhJykKfSBlbHNlIHsKCWNvbnNvbGUubG9nKCdEbyBub3QgcHJpbnQgdGhpcyEnKQp9CgovLyAyLiBVc2UgdGhlID09PSAoZXF1YWwgdG8pIG9wZXJhdG9yCmlmICh4ID09PSAxMCkgewoJY29uc29sZS5sb2coJ1ByaW50IHRoaXMhJykKfSBlbHNlIHsKCWNvbnNvbGUubG9nKCdEbyBub3QgcHJpbnQgdGhpcyEnKQp9CgovLyAzLiBVc2UgdGhlICE9PSAobm90IGVxdWFsIHRvKSBvcGVyYXRvcgppZiAoeCAhPT0gJ2NhdCcpIHsKCWNvbnNvbGUubG9nKCdQcmludCB0aGlzIScpCn0gZWxzZSB7Cgljb25zb2xlLmxvZygnRG8gbm90IHByaW50IHRoaXMhJykKfQoKLy8gNC4gV3JpdGUgeW91ciBvd24gdXNpbmcgd2hhdGV2ZXIgb3BlcmF0b3IgeW91IGxpa2UgOkQ="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Instructions:
// Write the following conditions so that 'Print this!' appears three times in the console
// Use the following variable when writing:
var x = 10

// 1. Use a < or a > (less than, or greater than) operator
if (x > 8) {
	console.log('Print this!')
} else {
	console.log('Do not print this!')
}

// 2. Use the === (equal to) operator
if (x === 10) {
	console.log('Print this!')
} else {
	console.log('Do not print this!')
}

// 3. Use the !== (not equal to) operator
if (x !== 'cat') {
	console.log('Print this!')
} else {
	console.log('Do not print this!')
}

// 4. Write your own using whatever operator you like :D
Native Browser JavaScript