Inheritance in JavaScript

As I have already mentioned I am .NET developer and something what is natural for js for me is just strange, one of such things is that JavaScript has only functions. Authors of other languages developed a lot of stuff, for example in C# we have:

  • Classes (static, abstract and usual)
  • Structures
  • Interfaces
  • Enums
  • Methods
  • Properties
  • Arrays
  • Delegates
  • Events
  • Anonymous Methods
  • Partial methods and classes
  • other…

Continue reading


Stupid facts about JavaScript #1

During the first week of learning JavaScript I have found a few things that just confused me, things in which I could not believe until I test it, and today I am going to share some of them with you.

All of you familiar with holy wars at work regarding “Java or C#”, “comment or not comment”, “test or not to test”, “spaces vs tabs” etc. It’s like “to be or not to be” for developers, but it’s almost nothing in comparison with next lines of code:

var func = function(){
 // some logic here

 return {
 //some result here


var func = function(){
 // some logic here

 //some result here

What might be wrong here? Does it really matters what code style we are using in this case and where that curly bracket is? Continue reading