You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
14. *lastIndexOf()*: Takes takes a substring and if the substring exists in a string it returns the last position of the substring if it does not exist it returns -1
928
916
```js
929
-
string.charCodeAt(index)
917
+
string.lastIndexOf(index)
930
918
```
931
919
```js
932
920
let string = 'IloveJavaScript.IfyoudonotloveJavaScriptwhatelsecanyoulove.'
15. *concat()*: it takes many substrings and creates concatenation.
927
+
15. *concat()*: it takes many substrings and creates concatenation.
940
928
```js
941
-
string.concate(substring, substring, substring)
929
+
string.concat(substring, substring, substring)
942
930
```
943
931
```js
944
932
let string = '30'
@@ -948,7 +936,7 @@ console.log(country.concat("land")) // Finland
948
936
949
937
```
950
938
951
-
16. *startsWith*: it takes a substring as an argument and it checks if the string starts with that specified substring. It returns a boolean(true or false).
939
+
16. *startsWith*: it takes a substring as an argument and it checks if the string starts with that specified substring. It returns a boolean(true or false).
17. *endsWith*: it takes a substring as an argument and it checks if the string starts with that specified substring. It returns a boolean(true or false).
955
+
17. *endsWith*: it takes a substring as an argument and it checks if the string starts with that specified substring. It returns a boolean(true or false).
18. *search*: it takes a substring as an argument and it returns the index of the first match.
971
+
18. *search*: it takes a substring as an argument and it returns the index of the first match.
984
972
```js
985
-
string.serch(substring)
973
+
string.search(substring)
986
974
```
987
975
```js
988
976
let string = 'IloveJavaScript.IfyoudonotloveJavaScriptwhatelsecanyoulove.'
989
977
console.log(string.search('love')) // 2
990
978
991
979
```
992
-
19. *match*: it takes a substring or regular expression pattern as an argument and it returns an array if there is match if not it returns null. Let us see how a regular expression pattern looks like. It starts with / sign and ends with / sign.
980
+
19. *match*: it takes a substring or regular expression pattern as an argument and it returns an array if there is match if not it returns null. Let us see how a regular expression pattern looks like. It starts with / sign and ends with / sign.
993
981
```js
994
982
let string = 'love'
995
983
let patternOne = /love/ // with out any flag
@@ -1021,6 +1009,13 @@ let regEx = /\d+/ // d with escape character means d not a normal d instead acts
29.Calculatethetotalannualincomeofthepersonbyextractthenumbersfromthefollowingtext.'He earns 5000 euro from salary per month, 10000 euro annual bonus, 15000 euro online courses per month.'
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!? %Th#is 30#Days&OfJavaScript &is also $the $result of &love& of tea&ching'
1193
+
constsentence = '%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!? %Th#is 30#Days&OfJavaScript &is also $the $result of &love& of tea&ching'
0 commit comments