屌你老母邊撚個發明type script

60 回覆
27 Like 16 Dislike
2020-05-18 03:02:16
你媽 == 呀媽
我媽 == 呀媽
但你媽 != 我媽 用discrete math角度睇都唔係錯

https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Equality_comparisons_and_sameness
2020-05-18 03:19:04
你個例子唔啱
你老母我老母都只係老母嘅instance
一定唔會 == 老母呢個Constructor
2020-05-19 14:31:46
class Student {
    fullName: string;
    constructor(public firstName: string, public middleInitial: string, public lastName: string) {
        this.fullName = firstName + " " + middleInitial + " " + lastName;
    }
}

interface Person {
    firstName: string;
    lastName: string;
}

function greeter(person: Person) {
    return "Hello, " + person.firstName + " " + person.lastName;
}

let user = new Student("Jane", "M.", "User");

document.body.textContent = greeter(user);
2020-05-19 14:32:44
function greeter(person) {
    return "Hello, " + person;
}

let user = "Jane User";

document.body.textContent = greeter(user);


花式簡單複雜化
2020-05-19 17:42:45
有冇得解
2020-05-19 18:24:33
2020-05-19 19:14:17
python都係
要+=1 唔可以++
2020-05-19 19:40:01
return state = state + 1?咁撚怪
唔係return state + 1就得?
2020-05-19 19:48:20
operator overload先會出現咁多confusion
2020-05-19 19:56:58
JavaScript冇operator overload
2020-05-19 19:58:06
用semicolon咪冇事lo
呢個eslint可以disable
2020-05-19 19:59:06
個concept係
2020-05-19 19:59:57
何來mutation?
2020-05-19 20:05:27
好錯喎ching...
empty array係true唔係false
吹水台自選台熱 門最 新手機台時事台政事台World體育台娛樂台動漫台Apps台遊戲台影視台講故台健康台感情台家庭台潮流台美容台上班台財經台房屋台飲食台旅遊台學術台校園台汽車台音樂台創意台硬件台電器台攝影台玩具台寵物台軟件台活動台電訊台直播台站務台黑 洞