pull/748/merge
muha 2 years ago committed by GitHub
commit a72cc6efb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,7 +5,11 @@
<title>30DaysOfJavaScript</title> <title>30DaysOfJavaScript</title>
</head> </head>
<body> <body>// Variables can also be declaring in one line separated by comma
let name = 'Asabeneh', //name of a person
job = 'teacher',
live = 'Finland'
<h1>30DaysOfJavaScript:02 Day</h1> <h1>30DaysOfJavaScript:02 Day</h1>
<h2>Data types</h2> <h2>Data types</h2>

@ -4,9 +4,11 @@ let string = 'JavaScript'
let firstLetter = string[0] let firstLetter = string[0]
console.log(firstLetter) // J console.log(firstLetter) // J
let secondLetter = string[1] // a let secondLetter = string[1] // a
let thirdLetter = string[2] let thirdLetter = string[2]//v
let lastLetter = string[9] let lastLetter = string[9]//a
console.log(lastLetter) // t console.log(lastLetter) // t
let lastIndex = string.length - 1
let lastIndex = string.length //will return the number of charactere that
console.log(lastIndex) // 9 console.log(lastIndex) // 9
console.log(string[lastIndex]) // t console.log(string[lastIndex]) // t

@ -1,5 +1,5 @@
// charAt(): Takes index and it returns the value at that index // charAt(): Takes index and it returns the value at that index
string.charAt(index) // string.charAt(index)
let string = '30 Days Of JavaScript' let string = '30 Days Of JavaScript'
console.log(string.charAt(0)) // 3 console.log(string.charAt(0)) // 3
let lastIndex = string.length - 1 let lastIndex = string.length - 1

@ -8,4 +8,13 @@ console.log(string.endsWith('in this world')) // true
let country = 'Finland' let country = 'Finland'
console.log(country.endsWith('land')) // true console.log(country.endsWith('land')) // true
console.log(country.endsWith('fin')) // false console.log(country.endsWith('fin')) // false
console.log(country.endsWith('Fin')) // false
// StartsWith is a helper function that takes a string and it returns a boolean value
let verb = 'Here you can'
console.log(verb.startsWith('Here')) // true
//@is there startwith

@ -3,7 +3,7 @@ let string = 'love'
let patternOne = /love/ // with out any flag let patternOne = /love/ // with out any flag
let patternTwo = /love/gi // g-means to search in the whole text, i - case insensitive let patternTwo = /love/gi // g-means to search in the whole text, i - case insensitive
string.match(substring) string.match(substring)
let string = 'I love JavaScript. If you do not love JavaScript what else can you love.' let strings = 'I love JavaScript. If you do not love JavaScript what else can you love.'
console.log(string.match('love')) // console.log(string.match('love')) //
/* /*
output output

Loading…
Cancel
Save