Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
v413
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
v413
13y ago
No. asm.js is simply a subset of javascript. That is all. Here is the actual spec: http://asmjs.org/spec/latest/ The creation of big typed array simulating a memory pool is a construction of Emscripten. asm.js in
32.
▲
by
v413
13y ago
Markup generated from javascript isn't manageable enough. That is why it is not recommended to have templates/markup generated from js.
33.
▲
by
v413
13y ago
You can use JSHint to fine-tune your linting rules.
34.
▲
by
v413
13y ago
It is possible , e.g. if your javascript on the page is already using a common js module system, you can simply "require" the necessary modules. In addition, you can have a global pub/sub system in place (that you can "require" from you inl
35.
▲
by
v413
13y ago
You can serve JS code that is wrapped in an anonimous function itself.
36.
▲
by
v413
14y ago
The problem with `self` is that it is already a predefined global variable in the browser pointing to the global object :) And btw, the `this` situation with javascript is not that bad :) use bind - either the Ecmascript 5 version or shimme
37.
▲
by
v413
14y ago
Well you might just use some other name than `self` e.g. I use var _this = this;
38.
▲
by
v413
14y ago
IMO the use of self as the name of the variable referencing to 'this' is a little dangerous, because in a function, if you miss the line var self = this, self is a valid reference to the window object, so you will not get an expected error
39.
▲
by
v413
14y ago
Point 7 is wrong. Example: a = {k: 10}; b = {k: 20}; var fn = function () {with (a) {this.k = 30;}}; fn.call(b); console.log("a.k: ", a.k); // 10 console.log("b.k: ", b.k); // 30
40.
▲
by
v413
14y ago
This will not work - Check my solution below :) document.getElementsByTagName returns a DOM Node List and it does not have forEach method according to the DOM spec. DOm Nodes, Elements and Node Lists and Node Maps do not follow the javascri
41.
▲
by
v413
14y ago
The right way is this :) Array.prototype.forEach.call(document.getElementsByTagName('p'), function(el) { el.innerHTML = 'Hello.'; });
42.
▲
by
v413
14y ago
This enumeration is done the wrong way. You enumerate over a DOM node list which looks like an array, which includes enumerable properties like "length". This means that the variable "p" at some point will be "length" and "length".innerHTML
43.
▲
by
v413
15y ago
Here though it is not about blaming software or hardware people. Here is what John Carmack talks about his troubles with the lack of PC performance due to the multitude of APIs to reach the hardware: John Carmack: ... That's really been dri
44.
▲
by
v413
15y ago
Please read the whole article first and then post here. You will see that this teacher actually comes with a reasonable solution to the problem (described at the end of his article). Please don't post without RTFA.
45.
▲
by
v413
16y ago
For highly technical analysis of the ECMA Script (JavaScript) language I highly recommend the series of articles of Dimitry Soshnikov. http://dmitrysoshnikov.com/ecmascript/javascript-the-core/ These series of articles are probably the de
46.
▲
by
v413
16y ago
It is interesting to see the HTML 5 compatibility charts (including for canvas) according to w3.org here: http://test.w3.org/html/tests/reporting/report.htm According to this no browser is currently following 100% the canvas spec.
47.
▲
by
v413
16y ago
He meant that, as far as the tests in the main article, Webkit has nothing to do with the results. Chrome uses the V8 javascript engine, Safari uses the Nitro javascript engine, while the webkit project are building their own javascript eng
48.
▲
by
v413
16y ago
Lets compare the constructor: function A () { this.helloWorld = function () {return 'hello world'}; }; a = new A(); vs. function B () {}; B.prototype.helloWorld = function () {return 'hello world'}; b = new B(); Both constructors achie
49.
▲
by
v413
16y ago
Intel is already preparing optical interconnect products (starting with 10gb/s) based on Light Peak. http://www.anandtech.com/print/3834 http://techresearch.intel.com/articles/None/1813.htm
50.
▲
by
v413
16y ago
In the browser, all DOM events and timers are executed in the main thread along with the html parser, dom layout and rendering, css parsing etc. So if the javascript handling an event takes too long it will block everything else and hence U