You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
2.6 KiB
80 lines
2.6 KiB
//---------------------------day1_level_1 1.exercise ------------------------\\
|
|
// Write a single line comment which says, comments can make code readable
|
|
|
|
// comments can make code readable
|
|
|
|
//---------------------------day1_level_1 2.exercise-------------------------\\
|
|
// Write another single comment which says, Welcome to 30DaysOfJavaScript
|
|
|
|
//Welcome to 30DaysOfJavaScript
|
|
|
|
//---------------------------day1_level_1 3.exercise-------------------------\\
|
|
// 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 */
|
|
|
|
//---------------------------day1_level_1 4.exercise-------------------------\\
|
|
// Create a variable.js file and declare variables and assign string, boolean,
|
|
// undefined and null data types
|
|
|
|
//variable.js
|
|
let string = 'nevzat'
|
|
let number = 25
|
|
let boolean = true
|
|
let nulll = null
|
|
let any; //undefined
|
|
|
|
//---------------------------day1_level_1 5.exercise-------------------------\\
|
|
// Create datatypes.js file and use the JavaScript typeof operator to check
|
|
// different data types. Check the data type of each variable
|
|
|
|
//type.js
|
|
console.log(typeof (string) )
|
|
console.log(typeof (number))
|
|
console.log(typeof (boolean))
|
|
console.log(typeof (nulll))
|
|
console.log(typeof (any))
|
|
|
|
//---------------------------day1_level_1 6.exercise-------------------------\\
|
|
// Declare four variables without assigning values
|
|
|
|
let variable1;
|
|
let variable2;
|
|
var variable3;
|
|
let variable4;
|
|
|
|
//---------------------------day1_level_1 7. exercise------------------------\\
|
|
// Declare four variables with assigned values
|
|
|
|
variable1 = "nevzat"
|
|
variable2 = "ATALAY"
|
|
variable3 = true;
|
|
variable4 = 25;
|
|
|
|
//---------------------------day1_level_1 8.exercise-------------------------\\
|
|
// Declare variables to store your first name, last name, marital status,
|
|
// country and age in multiple lines
|
|
|
|
let firstName = "nevzat"
|
|
let lastName = "atalay"
|
|
let old = 25
|
|
let isMarried = true
|
|
|
|
//---------------------------day1_level_1 9.exercise-------------------------\\
|
|
// Declare variables to store your first name, last name, marital status,
|
|
// country and age in a single line
|
|
|
|
let name = "nevzat",surName="atalay",age = 25, married = true
|
|
|
|
//---------------------------day1_level_1 10.exercise------------------------\\
|
|
// Declare two variables myAge and yourAge and assign them initial values
|
|
// and log to the browser console.
|
|
|
|
let myAge= 25
|
|
let yourAge = 22
|
|
|
|
console.log("I am " + " " + myAge + " " + "years old.")
|
|
console.log("You are" + " " + yourAge + " " + "years old.")
|