From 8d1046abe056c0eaa19dc8f85974795111ce5e9c Mon Sep 17 00:00:00 2001 From: Kevin Hui Date: Sun, 29 May 2022 23:33:49 -0400 Subject: [PATCH] finish day 1 --- 01_Day_Introduction/day1/datatypes.js | 21 +++++++++++++++++++++ 01_Day_Introduction/day1/helloworld.js | 10 ++++++++++ 01_Day_Introduction/day1/index.html | 13 +++++++++++++ 01_Day_Introduction/day1/introduction.js | 1 + 01_Day_Introduction/day1/variable.js | 13 +++++++++++++ 5 files changed, 58 insertions(+) create mode 100644 01_Day_Introduction/day1/datatypes.js create mode 100644 01_Day_Introduction/day1/helloworld.js create mode 100644 01_Day_Introduction/day1/index.html create mode 100644 01_Day_Introduction/day1/introduction.js create mode 100644 01_Day_Introduction/day1/variable.js diff --git a/01_Day_Introduction/day1/datatypes.js b/01_Day_Introduction/day1/datatypes.js new file mode 100644 index 0000000..3a9b7a9 --- /dev/null +++ b/01_Day_Introduction/day1/datatypes.js @@ -0,0 +1,21 @@ +//5. Create datatypes.js file and use the JavaScript typeof operator to check different data types. Check the data type of each variable +console.log(typeof Name) +console.log(typeof human) +console.log(typeof x) +console.log(typeof Null) +//6. Declare four variables without assigning values +let a +let b +let c +let d +//7. Declare four variables without assigning values +const one = 1 +const two = 2 +const three = 3 +const four = 4 +//8. Declare variables to store your first name, last name, marital status, country and age in multiple lines +let FirstName = "kevin" +let LastName = "H" +let MaritalStatus = "single" +let country = "USA" +let age = 24 diff --git a/01_Day_Introduction/day1/helloworld.js b/01_Day_Introduction/day1/helloworld.js new file mode 100644 index 0000000..5a97abf --- /dev/null +++ b/01_Day_Introduction/day1/helloworld.js @@ -0,0 +1,10 @@ +console.log("Hello, World!") +//1. Write a single line comment which says, comments can make code readable +//comments can make code readable + +//2. Write another single comment which says, Welcome to 30DaysOfJavaScript +//Welcome to 30DaysOfjavaScript + +//3. Write a multiline comment which says, comments can make code readable, easy to reuse and informative +/*comments can make code Readable, +easy to reuse and informative*/ \ No newline at end of file diff --git a/01_Day_Introduction/day1/index.html b/01_Day_Introduction/day1/index.html new file mode 100644 index 0000000..f3fdbbd --- /dev/null +++ b/01_Day_Introduction/day1/index.html @@ -0,0 +1,13 @@ + + + + Multiple External Scripts + + + // + + + + + + \ No newline at end of file diff --git a/01_Day_Introduction/day1/introduction.js b/01_Day_Introduction/day1/introduction.js new file mode 100644 index 0000000..316199c --- /dev/null +++ b/01_Day_Introduction/day1/introduction.js @@ -0,0 +1 @@ +console.log('Welcome to 30DaysOfJavaScript') \ No newline at end of file diff --git a/01_Day_Introduction/day1/variable.js b/01_Day_Introduction/day1/variable.js new file mode 100644 index 0000000..4740516 --- /dev/null +++ b/01_Day_Introduction/day1/variable.js @@ -0,0 +1,13 @@ +//4. Create a variable.js file and declare variables and assign string, boolean, undefined and null data types +let Name = "kevin" +let human = true +let x +let Null = null + +//9.Declare variables to store your first name, last name, marital status, country and age in a single line +let FirstName1 = "kevin", LastName1 = "H", MaritalStatus1 = "single", country1 = "USA", age1 = 24 + +//10.Declare two variables myAge and yourAge and assign them initial values and log to the browser console. +let myAge = 24 +let yourAge = 21 +console.log(myAge,yourAge)