From 2cfa97c5279ca1261b70c29b184d51351584445c Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 3 Dec 2019 19:56:58 -0600 Subject: [PATCH 1/3] testing testing --- 01week/datatypes.js | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/01week/datatypes.js b/01week/datatypes.js index 063141ebe..3af490871 100644 --- a/01week/datatypes.js +++ b/01week/datatypes.js @@ -1,23 +1 @@ -Date(); //Display Date and Time - -.toString(); //Converts a number to a string - -Number(''); //Converts a string to a number - -Boolean(); //Takes in different data types and prints out whether its a boolean - -console.log(typeof ); //Checking if different data types is a Boolean, Null, Undefined, Number, NaN, String - -console.log(12 + 12); //Adds two numbers together - -if (x==true && y==true) { - console.log("true") - } //Program that runs only of both values are true - -if (x==true || y==true) { - console.log("true") - } //Program that runs only if one of the values is true - - if (x!==true && y!==true) { - console.log("true") - } //Program that only runs of both calues are not true \ No newline at end of file +console.log("Starting Assignment 1"); From d866177c9e5434da1657991dca27e86a1b9994e1 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 5 Dec 2019 19:14:15 -0600 Subject: [PATCH 2/3] JsIntro v1 --- 01week/datatypes.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/01week/datatypes.js b/01week/datatypes.js index 3af490871..cef112e7e 100644 --- a/01week/datatypes.js +++ b/01week/datatypes.js @@ -1 +1,26 @@ -console.log("Starting Assignment 1"); +//Write a JavaScript program to display the current day and time. + +let currentDate = new Date(); + +console.log("The current date and time is", currentDate); + +//Write a JavaScript program to convert a number to a string. + +var num = 15; +var n = num.toString(); + +console.log("The number is", num); +console.log("The string representing the number is", n); + +//Write a JavaScript program to convert a string to the number. + +var string = "222"; +var w = Number(string); + +console.log("My 222 string changed to a number is", w); + +//Write a JavaScript program that takes in different datatypes and prints out their datatype + +console.log("This program will tell you it is a", typeof true); + +console.log("This program will tell you it is a", typeof ); From 61fb0c7963d376c3e11db6ab67fd7e43115d8793 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 Dec 2019 18:31:02 -0600 Subject: [PATCH 3/3] datatypesFinal --- 01week/datatypes.js | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/01week/datatypes.js b/01week/datatypes.js index cef112e7e..bc3e6ca6b 100644 --- a/01week/datatypes.js +++ b/01week/datatypes.js @@ -21,6 +21,38 @@ console.log("My 222 string changed to a number is", w); //Write a JavaScript program that takes in different datatypes and prints out their datatype -console.log("This program will tell you it is a", typeof true); +console.log( + "This program will tell you the data type of a value using typeof followed by the value" +); -console.log("This program will tell you it is a", typeof ); +typeof "heyyo"; + +var num1 = 2; + +var num2 = 44; + +console.log("The two num variables added together are:", num1 + num2); //This is a program that will add the two "num" variables together. + +x = true; + +y = true; + +if (x == true && y == true) { + console.log("both are true"); +} //This is a program that only runs of both of the variables are true. + +x = true; + +y = 0; + +if (x == true || y == true) { + console.log("one is true"); +} //This is a program that will only run if one of the variables is true. + +x = 5; + +y = 6; + +if (x !== true && y !== true) { + console.log("both are not true"); +} //This is a program that will only run if both of the variables are not true.