In the middle of Mozilla documentation page it switches (without clear enough explanation) examples from  WorkerBee.prototype = Object.create(Employee.prototype);   to   WorkerBee.prototype = new Employee;   Second form new Employee will initialize p...
this would be my first question ever on stackoverflow, hope this goes well. I've been working on a game (using corona SDK) and I used Node.js to write a small little server to handle some chat messages between my clients, no problems there. Now I...
The answer to this question: What is the initial value of a JavaScript function's prototype property?  has this sentence:     The initial value of prototype on any newly-created Function instance is a new instance of Object   As far as I know, Ja...
I'm working on some sort of online multiuser editor / coop interface, which will be doing a lot (as in, thousands) of ajax requests during one page lifetime.  What would be best: ('best' in terms of stability, compatibility, avoiding trou...
Is it possible to find foreign instances of certain website? Ofc theese are independently opened tabs (not by window.open). I need to prevent user from opening 2 tabs, and send message to previously opened tab to inform that it's impossible to op...
I would like to make some properties of an object to be hidden and some to be visible on iteration. So I tried to use prototype but that's not working:  ?function Car(){}  Car.prototype.version = '1.0';  var car_instance = new Car(); car_...
I have a class like this:  class Person {     private _age: number;      get age(): number {         return this._age;     }      set age(value: number) {         this._age = value;     } }   And an instance of that class:  let peter = new Person();...
I'm trying to create a way to store and load maps for an HTML5 canvas game. In order to do so, I must create new instances of objects (functions) referenced by a variable. This is my code.      function Map(w, h) {         if (typeof w == "un...
I'm trying to call an instance's method with a delay of 750ms. The problem is, it doesn't work. I've read that there's some sort of problem with setInterval and objects so probably there's one with setTimeout as well.  Say I h...
I have this code:    createNewDice = () =>{     let dice;     for(var i=0; i < 6; i++){       dice[i] = new Dice();     }     console.log(dice, 'dice')   }   when I call the method I get an error Cannot set property '0' of undef...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.