I used to be like that, but suddenly I tried to write a Java program, and I had a problem because I didn't know the class. If you think that the concept of class extends the program above the method, you can easily program it. Actually, I think Javascript classes are still coarser than Java and C #.
//Javascript(ES6)
import {hogehoge} from './hogehoge';
class hogehoge{
static hogehoge(height, width){
this.height = height;
this.width = width;
}
}
//Javascript
import hogehoge from './hogehoge';
class hogehoge{
static hogehoge(height, width){
this.height = height;
this.width = width;
}
}
//C#
using hoge;
class hoge{
public void hoge(height, width){
this.height = height;
this.width = width;
}
}
//Java
import hoge;
class hoge{
public void hoge(height, width){
this.height = height;
this.width = width;
}
}
As you may have noticed, it may be easier to understand if you look at the built-in part of the library. When actually embedding Java and C # are embedding by class name when actually embedding. In the case of Javascript (ES6) and Javascript, the class name and implementation library name exist. In the case of Javascript class, the built-in library name and the class name must match. In case of Java or C #, it can be implemented by writing the class name directly.
Another thing to be careful about is how to write the method. In the case of Java and C #, since the ancestor language is C or C ++, the void class always exists, but in the case of Javascript, it is completed by suddenly implementing the static method. This is a feature of scripting languages that is implemented with static and dynamic methods. In the case of Java and C #, compilation always follows. In the case of Javascript (ES6), it is also a feature that a method called transpile is adopted.
In the case of ES6, transpile has a problem that it cannot be implemented unless it is restored to the original writing style of Javascript. Transpile implements it. For now, transpile is implemented in Babel.
The difference between the compile language and the script language is whether the script is actually replaced with the intermediate language or the OS, or the script itself is rewritten. You have to be careful that Java and C # require compilation, and Javascript requires transpiling when implemented in ES6. If implemented in Javascript, transpile is not required.
Please note that this may happen.
Recommended Posts