Under the hood, are Javascript objects hash tables? [duplicate]

First of all, the answer is probably somewhat different for different JS engines. Also, I assume you’re specifically asking about the property storage; obviously objects have a bunch of other state too (prototype chain link being an obvious one). In the case of Spidermonkey, objects basically have a linked list of (propname, information about property) … Read more

How does setInterval and setTimeout work?

Javascript is singled-threaded but the browser is not. The browser has at least three threads: Javascript engine thread, UI thread, and timing thread, where the timing of setTimeout and setInterval are done by the timing thread. When calling setTimeout or setInterval, a timer thread in the browser starts counting down and when time up puts … Read more

Different results using the same maths in different browsers

The problem is not with the Javascript math; it’s with the canvas. http://jsfiddle.net/LDWBX/ function bigCircle(angle) { var radius = 5000; //the bigger, the worse var x = canvas.width/2 + radius*Math.cos(angle); var y = canvas.height/2 + radius*Math.sin(angle); ctx.beginPath(); ctx.arc(x, y, radius, 0, 2 * Math.PI); ctx.lineWidth = 2; ctx.stroke(); } Notice that numbers appear exactly the … Read more

Javascript Engines Advantages

There are various approaches to JavaScript execution, even when doing JIT. V8 and Nitro (formerly known as SquirrelFish Extreme) choose to do a whole-method JIT, meaning that they compile all JavaScript code down to native instructions when they encounter script, and then simply execute that as if it was compiled C code. SpiderMonkey uses a … Read more

Embedding JavaScript engine into .NET [closed]

Try Javascript .NET. It is hosted on GitHub It was originally hosted on CodePlex, here) Project discussions: http://javascriptdotnet.codeplex.com/discussions It implements Google V8. You can compile and run JavaScript directly from .NET code with it, and supply CLI objects to be used by the JavaScript code as well. It generates native code from JavaScript.

tech