Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- console.log(100 + 10); // 110
- console.log(100 - 10); // 90
- console.log(100 * 10); // 1000
- console.log(100 / 10); // 10
- console.log(100 % 10); // 0
- console.log("hello world"); // 'hello world'
- console.log("9"); // '9'
- console.log("9" + 1); // '91'
- let number = 100;
- let number2 = 10;
- console.log(number + number2); // 110
- console.log(number - number2); // 90
- console.log(number * number2); // 1000
- console.log(number / number2); // 10
- console.log(number % number2); // 0
- let string = "hello";
- console.log(string); // "hello"
- function add (one, two) {
- return one + two;
- }
- let ten = add(5, 5); // 10
- console.log(ten); // 10
- function capitalize (string) {
- console.log(string.toUpperCase());
- }
- capitalize(string); //HELLO
- let tru = true;
- let fal = false;
- console.log(tru);
- console.log(fal);
- // === asks if the two things are "the same"
- if (tru === true) { // true is equal / "the same" to true so it prints 'tru is true'
- console.log("tru is true"); // 'true is tru'
- }
- if (fal === true) { // nothing occurs because fal isn't true
- console.log("fal is true"); // nothing
- }
- function isOdd (number) {
- return (number % 2 === 1);
- }
- let question = isOdd(2);
- console.log(question);
- if (isOdd(7)) {
- console.log('7 is an odd number');
- }
Add Comment
Please, Sign In to add comment