Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Javascript , complete the following tasks below: You also need to use innerHTML . Show how prototype enables you to extend an existing String
Using Javascript, complete the following tasks below: You also need to use innerHTML.
Show how prototype enables you to extend an existing String class by writing a JavaScript method that will perform the following tasks: Use a method named "divideby235" The method takes in one argument The argument is an English word The method needs to check whether the English word is in the string If the English word is in the string, the method will count the number of characters in the English word and return: o This word can be divided by 2" if the number of characters of the word is divisible by 2 "This word can be divided by 3" if the number of characters of the word is divisible by 3 This word can be divided by 5" if the number of characters of the word is divisible by 5 o This word cannot be divided by 2, 3 or 5 if the number of characters of the word is NOT divisible by 2, 3 or 5 If the English word is NOT in the string, the method will return "This word is NOT in the string" In addition, show how you make use of your new method by using innerHTMLStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started