diff --git a/01_Day_Introduction/01_day_starter/datatypes.js b/01_Day_Introduction/01_day_starter/datatypes.js new file mode 100644 index 0000000..4effec6 --- /dev/null +++ b/01_Day_Introduction/01_day_starter/datatypes.js @@ -0,0 +1,60 @@ +// typeof operator, checks datatype of variables + +console.log(typeof character); +console.log(typeof characterIQ); +console.log(typeof characterIsMarried); +console.log(typeof testOfUndefined); +console.log(typeof emptyValue); + +// variables without values + +let test1; +let test2; +let test3; +let test4; + +console.log(test1, test2, test3, test4); + +// variables with assigned values + +const varWithValue = "assigned value"; +let test = false; +console.log(test); +test = true; +const num = 100; +let operator; +console.log(varWithValue, test, num, operator); + +// variables in multiple lines + +let characterFirstName = "Penny"; +let characterLastName = "Hofstadter"; +let characterIsMarriedStatus = true; +let characterCountry = "USA"; +let characterAgeOf = 22; + +console.log( + characterFirstName, + characterLastName, + characterIsMarriedStatus, + characterCountry, + characterAgeOf +); + +//variables in single line + +let firstNameTest = "Max", + lastNameTest = "Mustermann", + isMarriedTest = false, + countryTest = "Musterland", + ageTest = null; + +console.log(firstNameTest, lastNameTest, isMarriedTest, countryTest, ageTest); + +// age variables with initial values + +let myAge = 35; +let yourAge = 74; + +console.log("I am " + myAge + " years old."); +console.log("You are " + yourAge + " years old."); diff --git a/01_Day_Introduction/01_day_starter/helloworld.js b/01_Day_Introduction/01_day_starter/helloworld.js index 8c9e2c0..24601a1 100644 --- a/01_Day_Introduction/01_day_starter/helloworld.js +++ b/01_Day_Introduction/01_day_starter/helloworld.js @@ -1 +1,13 @@ -console.log('Hello, World!') \ No newline at end of file +console.log("Hello, World!"); + +// comments + +// single comment: comments can make code readable + +// Welcome to 30DaysOfJavaScript + +/* +multiline comment: +comments can make code readable, +easy to reuse and informative +*/ diff --git a/01_Day_Introduction/01_day_starter/index.html b/01_Day_Introduction/01_day_starter/index.html index 7ed5b19..ef45505 100644 --- a/01_Day_Introduction/01_day_starter/index.html +++ b/01_Day_Introduction/01_day_starter/index.html @@ -1,19 +1,17 @@ +
+