Hacker News new | comments | show | ask | jobs | submit login

> var editor = new Behave({

> var editor = Behave({

Is it a constructor or not?

On further inspection, it must be a constructor.

The second case is incorrect. The function assigns to "this", which would be undefined in strict mode, or the global object. Very bad either way.

Remember kids: objects are your friend.

Thank you good sir. It is a constructor, I've fixed the sites

I wish it could be var editor = now Behave({

var editor = oh Behave({

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact