About 152,000 results
Open links in new tab
  1. javascript - variable and function declaration in classes in ES6 ...

    Dec 24, 2017 · When using ES6 class, you can't declare a variable using var, let or const but you can define instance variables and static variables. The basic difference been that instance …

  2. What is the best way to declare functions within a Javascript class ...

    May 24, 2017 · function SomeFunction() { // Function Expression this.func1 = function() { } // Function Declaration function func2() { } } Update: Based in your question: What is the best …

  3. What are "class fields" in JavaScript? - Stack Overflow

    Aug 22, 2019 · The introduction of class fields also allows for private class fields, which also come with a few benefits: By defining things which are not visible outside of the class, ESnext …

  4. How to set up '_this' or 'self' when using javascript 'class' declaration

    Nothings broken, I just wanted to be able to alias 'this' when using 'class' declaration if possible. I don't fully understand the edge case workings of 'this' yet, so I alias as it is quite predictable.

  5. Is it possible to extend a JavaScript class after the declaration?

    Is there a way to have Student extend Person without having the extends in the class declaration? EDIT: [more detail] The reason I'm using this pattern is because I'd like to use Mongoose's …

  6. Confusing Javascript class declaration - Stack Overflow

    Apr 1, 2010 · Because JavaScript doesn't have block scope, your choice is (mostly) to have all variable reside in global or function scope. The author of your snippet wants to declare some …

  7. syntax - class variable in Javascript - Stack Overflow

    Jun 18, 2016 · The variation of a 'Class' in JavaScript should be defined as such: // I use function statements over variable declaration // when a constructor is involved. function Person(name) { …

  8. javascript: what's the difference between a function and a class

    Aug 15, 2012 · JavaScript treats functions as first-class objects, so being an object, you can assign properties to a function. Hoisting is the JavaScript interpreter’s action of moving all …

  9. javascript - Private class variable declaration - Stack Overflow

    May 5, 2022 · I am trying declare a private class variable for a super class and I seem to have trouble doing so ...

  10. Difference between javascript class declaration - Stack Overflow

    Nov 20, 2014 · Difference between javascript class declaration. Ask Question Asked 10 years, 5 months ago.

Refresh