LoginSignup
5
1

More than 5 years have passed since last update.

TypeScriptでも愛が生まれた

Last updated at Posted at 2016-05-10

元ネタ:愛が生まれた
派生ネタ:JavaScriptでも愛が生まれた
愛が生まれる理由:なんで愛が生まれるのか

class Shouter {
    shout() {
        return String.fromCharCode(''.charCodeAt(0) & ''.charCodeAt(0));
    }
}

let shouter = new Shouter();

let button = document.createElement('button');
button.textContent = "Shout";
button.onclick = function () {
    alert(shouter.shout());
}

document.body.appendChild(button);

こちらで実行できます typescriptlang.org

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1