-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
22 lines (16 loc) · 712 Bytes
/
main.js
File metadata and controls
22 lines (16 loc) · 712 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
String Challenge
All Solutions Must Be In One Chain
You Can Use Concatenate
*/
let a = "Elzero Web School";
// Include This Method In Your Solution [slice, charAt]
console.log(a.charAt(2).toUpperCase() + a.slice(3, 6)); // Zero
// 8 H
console.log(a.charAt(a.indexOf('h')).toUpperCase().repeat(8)); // HHHHHHHH
// Return Array
console.log(a.split(" ", 1)); // ["Elzero"]
// Use Only "substr" Method + Template Literals In Your Solution
console.log(`${a.substr(0, 6)} ${a.substr(-6)}`); // Elzero School
// Solution Must Be Dynamic Because String May Changes
console.log(a.charAt(0).toLowerCase() + a.slice(1, a.length - 1).toUpperCase() + a.charAt(a.length -1).toLowerCase()); // eLZERO WEB SCHOOl