About 10,700,000 results
Open links in new tab
  1. oop - Does JavaScript have classes? - Stack Overflow

    May 2, 2010 · 29 Javascript is an object oriented programming language, nevertheless in 2015 with ECMA script 6 classes have been introduced and now is correct to use them like other …

  2. JavaScript classes and 'this' - Stack Overflow

    Aug 3, 2018 · The same rules apply here, since the function now belongs to an object again the this reference points to obj2. Classes Fist of all Javascript doesn't actually have classes. A js …

  3. How to instantiate a javascript class in another js file?

    Oct 10, 2012 · How to instantiate a javascript class in another js file? Asked 13 years ago Modified 4 years, 6 months ago Viewed 196k times

  4. JavaScript click event listener on class - Stack Overflow

    Aug 9, 2016 · If you use element.addEventListener ('click', event => { } to add the event to the element, the javascript will check every click internally anyway. If you add the event to all …

  5. How to get a JavaScript object's class? - Stack Overflow

    Aug 9, 2009 · I created a JavaScript object, but how I can determine the class of that object? I want something similar to Java's .getClass() method.

  6. javascript - Object vs Class vs Function - Stack Overflow

    Jul 8, 2013 · JavaScript does not have classes, and functions are actually objects in JavaScript (first-class citizens). The only difference that function objects have is that they are callable.

  7. oop - JavaScript Classes - Stack Overflow

    3 JavaScript classes are introduced in ECMAScript 6 and are syntactical sugar over JavaScript's existing prototype-based inheritance. The class syntax is not introducing a new object-oriented …

  8. oop - JavaScript private methods - Stack Overflow

    Sep 11, 2008 · In JavaScript extensible classes and private methods don't easily go hand in hand. My suggestion in this case would be to go with composition over inheritance. Create an …

  9. Javascript Array of Instances of a class - Stack Overflow

    Sep 18, 2018 · In JS, I have a class called player which is: class player { constructor (name) { this.name = name; } } and I have two instances of it, called PL1 and PL2: const PL1 = new …

  10. How to add/remove a class in JavaScript? - Stack Overflow

    Since element.className property is of type string, you can use regular String object functions found in any JavaScript implementation: If you want to add a class, first use String.indexOf in …