gpt4 book ai didi

coffeescript - 如何使用 CoffeeScript 的内置辅助函数?

转载 作者:行者123 更新时间:2023-12-04 14:17:01 25 4
gpt4 key购买 nike

CoffeeScript 自带几个 helper functions .如何使用它们? flatten(Array)例如。

最佳答案

这些函数似乎是供 CoffeeScript 编译器私有(private)使用的。使用像 Underscore.js 这样的通用库可能会更好。如果你想要这些功能。

coffee> _ = require('underscore')
coffee> _.flatten [1, 2, 3, [4, 5]]
[ 1, 2, 3, 4, 5 ]

关于coffeescript - 如何使用 CoffeeScript 的内置辅助函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9865205/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com