Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

现代编程语言最有趣的 10 大特性 #8

Open
justjavac opened this issue Nov 14, 2017 · 1 comment
Open

现代编程语言最有趣的 10 大特性 #8

justjavac opened this issue Nov 14, 2017 · 1 comment
Labels

Comments

@justjavac
Copy link
Contributor

justjavac commented Nov 14, 2017

文章现代编程语言最有趣的 10 大特性

音频:无

视频:无


原文Ten interesting features from various modern languages

@justjavac
Copy link
Contributor Author

justjavac commented Nov 27, 2017

对于 2 模式匹配 Pattern matching 有一个 js 库:

代码示例:

const { matches } = require('z')

const result = matches(1)(
  (x = 2)      => 'number 2 is the best!!!',
  (x = Number) => `number ${x} is not that good`,
  (x = Date)   => 'blaa.. dates are awful!'
)

console.log(result) // output: number 1 is not that good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant