Learn the JavaScript language core with Firebug or Chrome-devtoolbar

Source: Internet
Author: User
Tags list of attributes

Debugging page styles or scripts with Firebug and Chrome-devtoolbar is a daily must-do for front-end development. What kind of magical help can this development artifact bring us? These days to see some of the information to give me inspiration, can not through Firebug and Chrome-devtoolbar to discover the whole properties of JS global object? Can you find the attributes in the document object that are not commonly used and require deep understanding?

We're here to open 8!

I. Brief analysis of For-in statement

The for-in Loop, also known as an "enumeration," is used on a non-array object's traversal, which can return the value of a property or property in an object.

Technically, you can use the For-in Loop array (because the array in JavaScript is also an object), but this is not recommended. Because if the array object has been enhanced by custom functionality, a logic error can occur. Also, in For-in, the order (sequence) of the list of attributes is not guaranteed. So the best array uses the normal for loop, and the object uses the For-in loop.

There is an important hasOwnProperty () method that filters out attributes that extend or inherit from the prototype chain when traversing object properties.

Let's look at an example here:

// Object var obj = {    2,    2,    1 };   // extended a method to all objects if (typeof Object.prototype.other = = = "undefined") {    function  () {};}

We're using obj.other now.

Two. What is the object?

Three. Traversal method for a very simple object

Four. Native objects, built-in objects, and host objects in JavaScript

Five. New Reference manual: Learn the JavaScript language in depth using Firebug or Chrome-devtoolbar

Use Firebug or Chrome-devtoolbar to learn more about the JavaScript language core

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.