/typescript/

TypeScript part 21 (static)

2017-03-04 19:29:02

TypeScript

class Helper {
    static environment = "dev";

    public static log(...str): void {
        console.log(str);
    }
}

console.log(Helper.environment);
Helper.log("Wow", 1, true);

JavaScript

var Helper = (function () {
    function Helper() {
    }
    Helper.log = function () {
        var str = [];
        for (var _i = 0; _i < arguments.length; _i++) {
            str[_i - 0] = arguments[_i];
        }
        console.log(str);
    };
    Helper.environment = "dev";
    return Helper;
}());
console.log(Helper.environment);
Helper.log("Wow", 1, true);