Common mistakes when writing JavaScript using C # background

I am working on improving JavaScript code. I have seen several people write that too many people write JavaScript as another language such as C #. What are some common things I have chosen in C # - is that what I have to do differently in JavaScript?

+3
source share
3 answers

There is a great (and rewarding) JavaScript article here:

http://www.codeproject.com/KB/scripting/javascript-gotchas.aspx

It covers:

  • Twice equal
  • Global variables
  • Building inline types with the keyword 'new'
  • Building anything else without the keyword 'new'
  • parseInt does not assume base-10
  • typeof operator
  • operator instance
  • Missing data: null and undefined
  • undefined
  • Eval
  • "+"
  • NaN

...

+3

- Elisha Manor ( # JavaScript):

  • False-y
  • for... in Statement
+1

Commas on an object initializer; excellent in C # ... not so good in javascript.

+1
source

All Articles