Comparison Operators The table below explains the comparison operators. When using operators, be sure that the arguments are of the same data type; numbers should be compared with numbers, strings with strings, and so on. Please enter the corresponding operators according to the comments at right. val1 == val2 // are equal val1 ! val2 // not equal val1 <val2 // less than val1 === val2 // are strict equal (identical)
Please fill in the right keywords to test the conditions: Switch(day_of_week) { case 1: case 2: case 3: case 4: case 5: document.write("Working Days"); Break ; case 6: document.write("Saturday"); Break ; default: document.write("Today is Sunday"); break; }
Division The / operator is used to perform division operations: var x = 100 / 5; document.write(x); // Outputs 20 Try It Yourself Remember to handle cases where there could be a division by 0. Enter the character designated for division: /
Comments
Post a Comment