b123400 / diu.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

#爲呢個本來已經好多粗口嘅語言再加多啲粗口。

require('diu')
//or
<script src="diu.js"></script>

因爲: 屌(a) === a //true 所以你可以咁樣發泄:

document.getElementById('shit')
(document).getElementById('shit')
(document.getElementById('shit'))
((document.getElementById('shit')))
(((document.getElementById('shit'))))

整左幾個return this嘅property,所以可以咁寫:

currentUser.logout()
currentUser.老味.logout()
(currentUser).老味.logout()
.(currentUser).老味 == currentUser // true

之不過咁樣access function嘅話會有機會令到function裏面的this改變,比如話

user = {
  echo : function(){
    return this;
  }
}
// 雖然
user.echo === user.echo..仆街 // true
// 但係
user.echo() // return user
user.echo..仆街() // return accessor function

所以就整左個function去bind你個function:

(user,'echo')..仆街() // return 你

爲左可以靈活講粗口,呢個function會filter非英文字數字,於是可以咁寫:

(document,'get啲ElementById') -> docment.getElementById
(User,'log乜撚野in') -> User.login

呀仲有:

(err)  // throw err

(唔夠膽擺上npm)

About


Languages

Language:JavaScript 100.0%