My colleague has been using "new function()" with a lower case "f" to define new objects in JavaScript.  It seems to work well in all major browsers and it also seems to be fairly effective at hiding private variables.  Here's a...
I've been looking at the source code of my.class.js to find out what makes it so fast on Firefox. Here's the snippet of code used to create a class:  my.Class = function () {     var len = arguments.length;     var body = arguments[len - 1];...
Dear folks, what should I do with these error warnings that Closure Compiler outputs? Thank you very much for your ideas and code improtements on this particular type of error:   JSC_WRONG_ARGUMENT_COUNT: Function parseInt: called with 1 argument(s)....
I am getting the following error on combineReducers in Redux now.  Missing type annotation for A. A is a type parameter declared in function type [1] and was implicitly instantiated at call of combineReducers [2].  The code looks as follows, but is o...
I have noticed a significant performance difference among the various object instantiation methods. Furthermore, it seems as though the size of the object (i.e. # of properties) matters greatly sometimes.   Can anyone shed some light on the results o...
I notice that my app starts to become sluggish when I change urls too many times. I suspect this is because I have the routes set up in a way that they are instantiating a new view every time the url is visited, not sure if there is another way to do...
I'm currently working on Paper.js library typescript definition and I have trouble finding the right way to document some parts of the API.  The case can be reduced to the following: let's say we have an Animal class which has a static proper...
I am having a bit of trouble creating an instance of useful things  from another JS file, I would like to change the properties of the  instance and use the methods. Or whatever you suggest if this is not  possible. This extends and this construct ar...
I want to instantiate a simple JavaScript object, and call its method immediately. Is is possible to do it simply, like in PHP:  (new Class('attr', 'attr2'))->myMethod();   Is there a similar syntax in JavaScript?...
I want to create/instantiate an array objectArray with several objects, whereby the objects shall contain x and y (empty at the beginning).  The length (amount of objects) of objectArray needs to be the same as the length of i.e. arrayLong. How I hav...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.