skip to main | skip to sidebar

Making sense out of the views

Being agile is not forcing agile methodology.

Tuesday, April 14, 2009

do not use hasOwnProperty

The hasOwnProperty method does not look at the prototype chain: flight.hasOwnProperty('number') // true flight.hasOwnProperty('constructor') // false //use if (typeof flight["number"]) == "undefined") { }
Labels: javascript

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Lables

asp.net (4) asp.net ajax (2) asp.net mvc (4) c# (1) clr (4) css (11) database (1) Diagnostic (3) Entity Framework (15) javascript (26) Linq (2) Network (1) others (1) reflection (1) SharePoint (38) Software Design (5) svn (5) Unit Test (11) WCF (3) web design (2) WF (12) xslt (7)

Blog Archive

  • ▼  2009 (87)
    • ►  October (12)
    • ►  September (3)
    • ►  July (16)
    • ►  June (9)
    • ►  May (2)
    • ▼  April (20)
      • Reflection performance
      • How many chinese characters can a computer display?
      • divitus classitus
      • Object vs Function
      • delete
      • do not use hasOwnProperty
      • || and &&
      • test
      • context of setTimeout and eval
      • Anonymous function's contexgt
      • == vs ===
      • Overflow
      • Horizontal Formating of block element
      • The Containing Block
      • vertical-align
      • line-height
      • inherit
      • Pixel in CSS
      • Unit in css
      • Make IE more css2.1 compliant
    • ►  March (15)
    • ►  February (2)
    • ►  January (8)
  • ►  2008 (73)
    • ►  December (39)
    • ►  November (33)
    • ►  October (1)

About Me

Fred Yang
View my complete profile