@@ -69,23 +69,25 @@ 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
+ // Your code here
74
+ let codingPosition = ( inputString . indexOf ( "Coding" ) ) ;
75
+ // Your code here
76
+ let startsWithWelcome = ( inputString . startsWith ( " Welcome" ) ) ; // this returns true
77
+ let endsWithToday = ( inputString . endsWith ( "today" ) ) ; // this returns false
76
78
77
79
// 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
80
+ let lowercaseString = ( inputString . toLowerCase ( ) ) ; // Your code here
81
+ let uppercaseString = ( inputString . toUpperCase ( ) ) ; // Your code here
82
+ let trimmedString = ( inputString . trim ( ) ) ; // Your code here
83
+ let replacedString = ( trimmedString . replace ( "JavaScript" , "coding" ) ) ;
82
84
83
85
// 3. Breaking Apart
84
- let wordsArray ; // Your code here
86
+ let wordsArray = inputString . split ( ) ; // Your code here
85
87
86
88
// 4. Retrieving
87
- let firstCharacter ; // Your code here
88
- let extractedBootcamp ; // Your code here
89
+ let firstCharacter = trimmedString . charAt ( 0 ) ; // Your code here
90
+ let extractedBootcamp = trimmedString . slice ( 22 , 30 ) ; // Your code here
89
91
90
92
// Log all results
91
93
console . log ( {
0 commit comments