Skip to content

Isn’t polymorphism works wrong in JS ES

I’m currently working on a browser extension to manage opened tabs and I notice that in JS ES polymorphism works a bit strange when I declare class fields at the top of the class. Let say that we want to use polymorphism in object initialization. E.g. we have base class View: and derived class TabView: …

Images not displaying on dynamic generated content

I’m working on uploading multiple images one at a time by dynamically generating the input field and image element. However, my code doesn’t display the images on the dynamically generated image element. Answer Instead of making event handler for all files use can just one event handler and then i…

How does work LexicalEnvironment and VariableEnvironment?

In first example, I expected to see undefined instead 3. Why does console show 3 in first example? Is it related with LexicalEnvironment and VariableEnvironment? and Answer Why does console show 3 in first example? num is already declared in the environment, as parameter. Hence the var num statement is ignore…