Page 166 - DCAP202_Fundamentals of Web Programming
P. 166
Unit 13: Building Object of JavaScript
indexOf(): This method can be used to search down a string (from left to right) until it finds a Notes
string fragment matching the specified value.
Javascripts objects: JavaScript objects are collections of properties and methods.
Length: Length is a property of a string and receives its value indirectly based on the number of
characters in a string.
Math object: JavaScript's Math object provides advanced arithmetic and trigonometric functions,
expanding on JavaScript's basic arithmetic operators.
13.8 Review Questions
1. Explain, how JavaScript used as a scientific calculator.
2. What are the objects in JavaScript?
3. Define the methods of math object in JavaScript.
4. Discuss the properties of math object used in JavaScript.
5. How do you create a new object in JavaScript?
6. What are the user defined objects?
7. Explain the property and methods of date object.
8. What is string object?
9. Explain the Get methods of date object.
10. Differentiate between indexOf and lastindexOf methods in string object.
Answers: Self Assessment
1. Math 2. Date
3. property 4. Method
5. String 6. Prototype
7. constructor 8. Static
9. Date object 10. Date ()
11. Object 12. New
13. constructor 14. Variable
15. var
13.9 Further Readings
Books Hall, 2009, Core Web Programming, 2/E, Pearson Education India.
Jon Duckett, 2011, Beginning Web Programming with HTML, XHTML and CSS, John
Wiley & Sons.
Robert F. Breedlove,1996, Web Programming Unleashed, Sams.net.
LOVELY PROFESSIONAL UNIVERSITY 159