Q1. Write a function to validate given email has @ or not
isValidEmail("test@gmail.com") === true
isValidEmail("testmail.com") === false
Q2. Write a function check weather given email id is gmail or not
isGmailId("test@gmail.com") === true
isGmailId("test@yahoo.com") === false
Q3. Write a function to accept firstName and lastName as param and should return fullName
getFullName("John","Snow") == "John Snow";
Q4. Uppercase the first character
upperFirst("john") == "John";
Q5. Truncate a given string with a limit
truncate("What I'd like to tell on this topic is:", 20) =
"What I'd like to te…"
truncate("Hi everyone!", 20) = "Hi everyone!"
Q6. Function to extract currency value from given string
extractCurrencyValue('$120') === 120
Q7. Function mask every A with
stringMask("Its A sunny weather") === "Its # sunny we#ther";
Q8. Function to Count Decimal Points in a given number?
getDecimalCount("43.20") ➞ 2
getDecimalCount("400") ➞ 0
getDecimalCount("3.1") ➞ 1
Top comments (0)