JavaScript Object Knowledge points

Source: Internet
Author: User

1 // ----------tolocalestring ()--the use of methods--------------------------- 2 var New Date (); 3 document.write (now.tostring () + "<br/>"); 4 document.write (now.tolocalestring ());  // tolocalestring () returns the localized string representation of an object 5 6 7 Results: 8 Thu Jan 21:08:41 gmt+08009

1 //---------The use of the hasOwnProperty ()----method------------------------2 functionDwn (s) {3document.write (s+ "<br/>");4 }5 6 functionClassA () {7      This. A = 1;8 }9 Ten functionClassB () { One      This. B = 5; A } -  -Classb.prototype =NewClassA ();//mechanism for managing object inheritance the varOBJB =NewClassB (); -  - Dwn (OBJB); -Dwn ("a"inchOBJB); +Dwn ("B"inchOBJB); -Dwn ("A" is a property inherited from the prototype of Object B?) "+objb.hasownproperty (" a ")); +Dwn ("B" is the property inherited from the prototype of Object B?) "+objb.hasownproperty (" B ")); A  at  - Results: - [Object Object] - true - true -is a property inherited from the prototype of object B?false inB is the property inherited from the prototype of object B?true

JavaScript Object Knowledge points

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.