Skip to content

Instantly share code, notes, and snippets.

@jhartikainen
Last active December 13, 2016 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhartikainen/3b01e9c486213308e4e4f8b4013db6d0 to your computer and use it in GitHub Desktop.
Save jhartikainen/3b01e9c486213308e4e4f8b4013db6d0 to your computer and use it in GitHub Desktop.
JavaScript doesn't have classes lololo
//java
class X extends Y {
public X() {
super();
}
public void method() {
}
public static staticMethod() {
}
}
//javascript
class X extends Y {
contructor() {
super();
}
method() {
}
static staticMethod() {
}
}
//java
X obj = new X();
obj.method();
//javascript
var obj = new X();
obj.method();
//java
X.staticMethod();
//javascript
X.staticMethod();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment