-
Write a single line comment which says, comments can make code readable
-
Write another single comment which says, welcome to 30DaysOfJavaScript
-
Write a multiline comment which says, comments can make code readable, easy to use and informative
-
Create a variable.js file and declare variables and assign string, boolean, undefined and null data types
-
Create datatypes.js file and use the JavaScript typeof operator to check different data types. Check the data type of each variables
-
Declare four variables without assigning values
-
Declare four variables with assigning values
-
Declare variables to store your first name, last name, marital status, country and age in multiple lines
-
Declare variables to store your first name, last name, marital status, country and age in a single line
-
Declare two variables myAge and yourAge and assign them initial values and log to browser console. Output:
I am 25 years old.
You are 30 years old.
computer Day 2: Exercises String Part Declare a variable name challenge and assign it to an initial value '30 Days Of JavaScript'. Print the string on the browser console using console.log() Print the length of the string on the browser console using console.log() Change all the string to capital letters using toUpperCase() method Change all the string to lowercase letters using toLowerCase() method Cut(slice) out the first word of the string using substr() or substring() method Slice out the phrase Days Of JavaScript from 30 Days Of JavaScript. Use substr to slice out the phase because because because in the following sentence:'You cannot end a sentence with because because because is a conjunction' Check if the string contains a word Script using includes() method Split the string into array using split() method Split the string 30 Days Of JavaScript at the space using split() method 'Facebook, Google, Microsoft, Apple, IBM, Oracle, Amazon' split the string at the comma and change it to an array. Change 30 Days Of JavaScript to 30 Days Of Python using replace() method. What is character at index 15 in '30 Days Of JavaScript' string use charAt() method. What is the character code of J in '30 Days Of JavaScript' string using charCodeAt() Use indexOf to determine the position of the first occurrence of a in 30 Days Of JavaScript Use lastIndexOf to determine the position of the last occurrence of a in 30 Days Of JavaScript. Use indexOf to find the position of the first occurrence of the word because in the following sentence:'You cannot end a sentence with because because because is a conjunction' Use lastIndexOf to find the position of the first occurrence of the word because in the following sentence:'You cannot end a sentence with because because because is a conjunction' Use search to find the position of the first occurrence of the word because in the following sentence:'You cannot end a sentence with because because because is a conjunction' Use trim() to remove if there is trailing whitespace at the beginning and the end of a string.E.g ' 30 Days Of JavaScript '. Use startsWith() method with the string 30 Days Of JavaScript make the result true Use endsWith() method with the string 30 Days Of JavaScript make the result true Use match() method to find all the a’s in 30 Days Of JavaScript Use match() to count the number all because's in the following sentence:'You cannot end a sentence with because because because is a conjunction' Use concat() and merge '30 Days of' and 'JavaScript' to a single string, '30 Days Of JavaScript' Use repeat() method to print 30 Days Of JavaScript 2 times Love is the best thing in this world. Some found their love and some are still looking for their love. Count the number of word love in this sentence. Calculate the total annual income of the person by extract the numbers from the following text. 'He earns 5000 euro from salary per month, 10000 euro annual bonus, 15000 euro online courses per month.' Clean the following text(hint, use replace and regular express) sentence = '%I $am@% a %tea@cher%, &and& I lo%#ve %tea@ching%;. There $is nothing; &as& mo@re rewarding as educa@ting &and& @emp%o@wering peo@ple. ;I found tea@ching m%o@re interesting tha@n any other %jo@bs. %Do@es thi%s mo@tivate yo@u to be a tea@cher!?' Data types Part String, number, boolean, null, undefined and symbol(ES6) are JavaScript primitive data types.
The JavaScript typeof operator uses to check different data types. Check the data type of each variables from question number 1. Arithmetic Operators Part JavaScript arithmetic operators are addition(+), subtraction(-), multiplication(*), division(/), modulus(%), increment(++) and decrement(--).
let operandOne = 4; let operandTwo = 3; Using the above operands apply different JavaScript arithmetic operations.
Booleans Part Boolean value is either true or false.
Write three JavaScript statement which provide truthy value. Write three JavaScript statement which provide falsy value. Use all the following comparison operators to compare the following values: >, < >=, <=, !=, !==,===. Which are true or which are false ? 4 > 3 4 >= 3 4 < 3 4 <= 3 4 == 4 4 === 4 4 != 4 4 !== 4 4 != '4' 4 == '4' 4 === '4' Comparison Operators Boolean value is either true or false. Any comparison return a boolean either true or false. Use all the following comparison operators to compare the following values: >, < >=, <=, !=, !==,===. Which are true or which are false ?
4 > 3 4 >= 3 4 < 3 4 <= 3 4 == 4 4 === 4 4 != 4 4 !== 4 4 != '4' 4 == '4' 4 === '4' Logical Operators Which are true or which are false ?
4 > 3 && 10 < 12 4 > 3 && 10 > 12 4 > 3 || 10 < 12 4 > 3 || 10 > 12 !(4 > 3) !(4 < 3) !(false) !(4 > 3 && 10 < 12) !(4 > 3 && 10 > 12) !(4 === '4')