From ec218c4dda4611d1bfd62d3c530bb2238f0b4035 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 11 Oct 2018 17:33:36 -0500 Subject: [PATCH] initial commit --- 01week/datatypes.js | 54 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/01week/datatypes.js b/01week/datatypes.js index e69de29bb..4d284791b 100644 --- a/01week/datatypes.js +++ b/01week/datatypes.js @@ -0,0 +1,54 @@ +const day = date.getDay(); +const hour = date.getHours(); +const minute = date.getMinutes(); +console.log("today is " + [day] + " " + [hour] + ":" + [minute]); + + +const number = (x) => { + console.log(toString(x)); +} +number("84"); + + +const string = (number) => { + console.log(Number(number)); +} +string(48); + + +const type = (datatype) => { + console.log(typeof datatype); +} +type(false); + + +const add = (x, y) => { + console.log (x + y); +} +add(4,6); + + +const a = 6; +const b = 9; +const c = 12; + +function twoTrue() { + if (b>a && c>b) { + console.log(a+b); + } +} +twoTrue(); + +const oneTrue = (x,y) => { + if (x>y || x==y) { + console.log(x+y); + } +} +oneTrue(3,1); + +const noneTrue = (x,y) => { + if (!x>y && !x==y) { + console.log(x+y); + } +} +noneTrue(1,3); \ No newline at end of file