-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathq3.js
21 lines (21 loc) · 808 Bytes
/
q3.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"use strict";
// Q2: Name Cases: Store a person’s name in a variable, and then print that person’s name in lowercase, uppercase, and titlecase.
Object.defineProperty(exports, "__esModule", { value: true });
function q3() {
let name = "tech";
console.log(`Lowercase: ${name.toLowerCase()}`);
console.log(`Uppercase: ${name.toUpperCase()}`);
console.log(`Titlecase: ${name.charAt(0).toUpperCase() + name.slice(1)}`);
let sentence = "Hello i am abdul hannan";
let words = sentence.split(" ");
titleCaseWords.forEach(function (titleCaseWords) {
});
{
return word[0].toUpperCase() + word.slice(1).toLowerCase();
}
;
let titleCaseSentence = titleCaseWords.join(" ");
console.log(titleCaseSentence);
}
q3();
exports.default = q3;