HTML and CSS Reference
In-Depth Information
Why is it important to avoid creating custom JavaScript objects in the global
The global namespace is reserved for the browser.
The global namespace is available to all applications in the session, and using it
could result in a naming conflict.
The global namespace creates a security risk to users' systems.
What JavaScript keyword in an event handler can be easily used to reference the object
that raised the event?
The it keyword provides a reference to the object.
The document.current property provides a reference to the object.
The this keyword provides a reference to the object.
No way is available other than to use a selector query to retrieve the object from
the DOM.
Objective 1.6: Create and implement objects
and methods
JavaScript is an object-oriented programming language, which means that to develop
applications in JavaScript effectively, you must understand how to work with objects.
Essentially, two types of objects exist in JavaScript:
Native JavaScript objects, which are provided with JavaScript itself
Custom objects, which developers create to represent their own data constructs and
In some cases, creating an entirely new object isn't necessary. You can base objects on
other objects (if they are a subtype of that object) by using object inheritance, in which one
object inherits all the attributes and behaviors of another object but can also implement
additional aspects that are unique to it.
Objects encapsulate functionality and state information that is relevant for them. The
functionality is provided in the form of methods, whereas state information is provided in the
form of properties. This objective examines working with objects in JavaScript.
This objective covers how to:
Implement native objects
Create custom objects and custom properties for native projects using proto-
types and functions
Implement inheritance
Implement native methods and create custom methods
Search WWH ::

Custom Search