@@ -69,23 +69,23 @@ Complete the following tasks and assign the results to the specified variables.
69
69
let inputString = " Welcome to the Coding Bootcamp! Learn JavaScript today. " ;
70
70
71
71
// 1. Searching
72
- let hasJavaScript ; // Your code here
73
- let codingPosition ; // Your code here
74
- let startsWithWelcome ; // Your code here
75
- let endsWithToday ; // Your code here
72
+ let hasJavaScript = inputString . includes ( "JavaScript" ) ;
73
+ let codingPosition = inputString . indexOf ( "Coding" ) ;
74
+ let startsWithWelcome = inputString . startsWith ( "Welcome" ) ;
75
+ let endsWithToday = inputString . endsWith ( "today" ) ;
76
76
77
77
// 2. Transforming
78
- let lowercaseString ; // Your code here
79
- let uppercaseString ; // Your code here
80
- let trimmedString ; // Your code here
81
- let replacedString ; // Your code here
78
+ let lowercaseString = inputString . toLowerCase ( ) ;
79
+ let uppercaseString = inputString . toUpperCase ( ) ;
80
+ let trimmedString = inputString . trim ( ) ;
81
+ let replacedString = inputString . replace ( "JavaScript" , "Coding" ) ;
82
82
83
83
// 3. Breaking Apart
84
- let wordsArray ; // Your code here
84
+ let wordsArray = inputString . split ( " " ) ;
85
85
86
86
// 4. Retrieving
87
- let firstCharacter ; // Your code here
88
- let extractedBootcamp ; // Your code here
87
+ let firstCharacter = trimmedString . charAt ( 0 ) ;
88
+ let extractedBootcamp = trimmedString . slice ( 22 , 30 ) ;
89
89
90
90
// Log all results
91
91
console . log ( {
0 commit comments