Joined September 2013
·

Shawn Fumo

United States
·
·

@xander, perhaps it'd be better to put the note about JS not having integers at the top instead of the bottom? Or put an asterisk after "an integer" on the first line? Seems like it is easy to miss in the current spot.

@jailbot, nothing to do with interpreted vs not. It is just how JavaScript is defined in its language spec. Also, generally there can be different implementations of a language that might be compiled, interpreted, use a bytecode on a VM, etc.

In fact in Chrome (not sure what Firefox/IE do) whenever a JavaScript function is first run it is actually just-in-time compiled to assembly code along with some profiling code. If the function is run enough times it will use that info to recompile the function as more optimized assembly with "optimistic" assertions. It even does things like inlining methods. JavaScript is very dynamic but not necessarily interpreted at all.

Has anyone tested the memory issues of factory in recent Chromes? I saw a page recently that implied that functions defined and assigned to this in the constructor would be shared across instances if they weren't modified later on. I could be mistaken though..

Also, don't forget underscore's higher level methods. For instance, if you just want to call a method on each item, it'd be clearer to do: _.invoke(items, 'doSomeStuff'). Can use _.pluck to get a property off of a collection, etc.

Achievements
7 Karma
0 Total ProTip Views
Interests & Skills