10 ms·
It's worth using Babel's loose mode (es2015-loose in the online REPL) if you're more interested in the "old" way of doing it than in compatibility with the spec
by insin 9y ago
It's worth using Babel's loose mode (es2015-loose in the online REPL) if you're more interested in the "old" way of doing it than in compatibility with the specs:
"use strict";
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
var Dog = (function() {
function Dog() {
_classCallCheck(this, Dog);
}
Dog.prototype.bark = function bark() {
console.log("Bark!");
};
return Dog;
})();
https://babeljs.io/repl/#?babili=false&browsers=&build=&builtIns=false&code_lz=MYGwhgzhAEAiD2BzaBvAUNaAjMAnA1gBQCUq0w8AdhPCAKYB0ISh0ARAEJ74CEb0xANzQAvmhFA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&lineWrap=false&presets=es2016%2Creact%2Cstage-2%2Ces2015-loose&prettier=true&targets=&version=6.26.0&envVersion= https://babeljs.io/repl/#?babili=false&browsers=&build=&buil...