- 簡単なDOM操作
- getElementById
- getElementsByClassName
- querySelector(All)
- appendChild
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
import * as ReactDOM from "react-dom"; | |
interface ReactSliderAppState { | |
value: number; | |
} | |
class ReactSliderApp extends React.Component<void, ReactSliderAppState> { | |
constructor() { | |
super(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a = "Hello"; | |
let b = 5; | |
let c = new Date(); | |
let d = function D() { return true; }; | |
class E {}; | |
let e = new E(); | |
console.log(typeof a); // string | |
console.log(typeof b); // number | |
console.log(typeof c); // object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IWebsite { | |
title: string; | |
url: string; | |
} | |
class WebSite { | |
private _title: string; | |
private _url: string; | |
constructor(website: IWebsite) { | |
this._title = website.title; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let myclass = new MyClass(); | |
if (myclass instanceof IMyInterface) {} // Error "Cannot find name 'IMyInterface'" | |
if (myclass instanceof MyClass) {} // OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MyClass = (function () { | |
function MyClass() { | |
} | |
MyClass.prototype.myMethod = function () { | |
console.log("myMethod called"); | |
}; | |
return MyClass; | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IMyInterface { | |
myValue: string; | |
myMethod(): void; | |
} | |
class MyClass implements IMyInterface { | |
myValue: string; | |
myMethod(): void { | |
console.log("myMethod called"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface IMyInterface { | |
myValue: string; | |
myMethod(): void; | |
} |