-
Notifications
You must be signed in to change notification settings - Fork 44
Closed
Description
Hi, "let" keyword doesn't work when i using <HTMLCanvasElement>
Input:
"use strict";
var canvas: HTMLCanvasElement = <HTMLCanvasElement>document.getElementById("game"); // Problem
var ctx = canvas.getContext("2d");
/*function kare(ctx) {
this.x = 0;
this.y = 0;
this.w = 0;
this.h = 0;
this.draw = function () {
}
}*/
function image(){
this.x = 0;
}
let a: number = 1; // Problem
alert(a);
Output:
//Compiled TypeScript
"use strict";
var canvas = document.getElementById("game");
var ctx = canvas.getContext("2d");
function image() {
this.x = 0;
}
let;
a:
number = 1
alert(a);
Input:
"use strict";
// Deleted line
var ctx = canvas.getContext("2d");
/*function kare(ctx) {
this.x = 0;
this.y = 0;
this.w = 0;
this.h = 0;
this.draw = function () {
}
}*/
function image(){
this.x = 0;
}
let a: number = 1; // Working good
alert(a);
Output:
//Compiled TypeScript
"use strict";
var ctx = canvas.getContext("2d");
/*function kare(ctx) {
this.x = 0;
this.y = 0;
this.w = 0;
this.h = 0;
this.draw = function () {
}
}*/
function image() {
this.x = 0;
}
var a = 1; // Working good
alert(a);
Metadata
Metadata
Assignees
Labels
No labels