5

For testing, the code should be selected and copied directly from tweets . - approx. trans.

I recently found this tweet from <a href="https://twitter.com/FakeUnicode/"> @FakeUnicode < / a>. There was a JavaScript snippet that looked pretty innocuous, but displayed a hidden message. It took me some time to understand what was going on. I think that the record of the steps of my investigation may be of some interest to someone.

Here is the snippet:

image

What would you expect from him?

Here we use the for in loop, which passes through the enumerable properties of the object. Since only the property A is specified, we can assume that the message with the letter A will be shown. Well ... I was wrong. : D
KlauS 23 september 2017, 8:40

Introduction


I love different experiments with JavaScript. They allow us to look in the future and see how exciting it will be. When you will be viewing this collection, probably you will think of the recent king Adobe Flash, and then you realize how fast CSS and JavaScript took the throne away from it. Modern browsers allow us to use a variety of different effects and animations without any limitations. However, the word "experimental" means a number of limitations, such as the incorrect displaying in some browsers (IE), in addition, these plugins will be as conceptual addition to the personal pages, and not for use in the large projects.
BumBum 19 december 2012, 19:37

Sometimes, web developers get a task that requires a smooth movement of the object on the screen. This may be a download string, sprite, or something else. The problem occurs when the shift seems to be too abrupt even at one point, and that messes up the overall impression of the event. How do we avoid it? Should we use anti-aliasing techniques?

This can be done using the sprites, as well as smart reduction of the original image. Here are some steps that you need to follow:

First, we have a large image of a car.
image
BumBum 4 october 2012, 19:32

HTTP Archive statistics shoes the explosive growth of JavaScript in the Web. A year ago, the average size of scripts was 128 KB per the page, and now it is 189 KB.

image

On the one hand, it is great that this programming language is going through a sort of rebirth and the universal popularity. On the other hand, the expansion of scripts size loads up the browser and has a negative effect on the loading time of pages. It is very sad that to download one tweet (140 symbols) requires 1.65 MB of scripts.
BumBum 23 may 2012, 14:12

Do you know what value produce this code in JavaScript?

var foo = 1;
function bar() {
if (! foo) {
var foo = 10;
}
alert(foo);
}
bar();

If you are surprised what will produce "10", then the following code confuse you at all:


var a = 1;
function b () {
a = 10;
return;
function a() {}
}
b();
alert(a);

In this case, the browser produces "1". So what exactly is going on? Although this behavior seems strange, dangerous and confusing, in fact it is very powerful and significant tool JavaScript. There is a name for term for such behavior, which is “hoisting”. This article will try to explain the mechanism of the language, but first let us talk about scope in JavaScript.
Sparks 30 october 2011, 17:14