Lighting Edition
NDC Micro, March 2018
@kamranayub
"TypeScript is not interoperable with JavaScript"
aka
"I have to rewrite my JavaScript codebase"
var Point = function (x, y) {
this.x = x;
this.y = y;
};
Point.prototype.distance = function (other) {
other = other || new Point(0.0, 0.0);
return Math.sqrt(
Math.pow(this.x - other.x, 2) +
Math.pow(this.y - other.y, 2));
};
var p1 = new Point(5, 6);
var p2 = new Point(1, 1);
// Calculate distance between two points
console.log("Distance between", p1, p2, "is", p1.distance(p2));
It's just JavaScript!
And it's also TypeScript!
"TypeScript is not interoperable with JavaScript"
TypeScript is a typed superset of JavaScript that compiles down to plain, human-readable JavaScript
"I have to learn a whole new language"
aka
"I have re-learn JavaScript, my existing skills are useless"