@@ -60,20 +60,39 @@ fruits.forEach((fruit) => {
6060
6161//Reemplazo
6262let musicPlayer = 'Music Player current song: The Pretender - Foo Fighters'
63+ console . log ( musicPlayer )
6364
65+ musicPlayer = musicPlayer . replace ( 'The Pretender - Foo Fighters' , 'Monster - Skillet' )
6466console . log ( musicPlayer )
65- console . log ( musicPlayer . replace ( 'The Pretender - Foo Fighters' , 'Monster - Skillet' ) )
6667
6768//División
69+ const companiesString : string = 'Google, Apple, Telegram, Facebook'
70+ const companiesArr = companiesString . split ( ', ' )
71+
72+ console . log ( companiesArr )
6873
6974//Unión
75+ const colorsArray = [ 'blue' , 'red' , 'yellow' , 'white' ]
76+ const colorsString = colorsArray . join ( ', ' )
77+
78+ console . log ( colorsString )
7079
7180//Interpolación
72- console . log ( `\n\"TypeScript es JavaScript premium\" \n\n\t\t\t${ ric . toUpperCase ( ) } ` )
81+ console . log ( `\n\"TypeScript es JavaScript premium\" \n\n\t\t\t${ ric . toUpperCase ( ) } \n ` )
7382
7483//Verificación
84+ const fiveInSpanish : string = 'Cinco'
85+ const fiveCharsRegex = / \b [ A - Z a - z ] { 5 } \b / g
86+
87+ console . log ( 'Tiene cinco caracteres la palabra "cinco"?' , fiveCharsRegex . test ( fiveInSpanish ) )
7588
7689//Otros
90+ const randomPhrase = 'Pedro estaba bebiendo un jugo de manzana'
91+ const jRegex = / \b [ J j ] { 1 } [ A - Z a - z ] { 3 } \b / g
92+
93+ let result = randomPhrase . match ( jRegex )
94+
95+ console . log ( result )
7796
7897//EXTRA
7998function analyzeTheseWords ( word1 : string , word2 : string ) {
@@ -118,5 +137,5 @@ function analyzeTheseWords(word1: string, word2: string) {
118137 isogram ( word2 )
119138}
120139
121- // analyzeTheseWords('Roma', 'Amor')
122- // analyzeTheseWords('Radar', 'Paloma')
140+ analyzeTheseWords ( 'Roma' , 'Amor' )
141+ analyzeTheseWords ( 'Radar' , 'Paloma' )
0 commit comments