小编nru*_*uth的帖子

检查数组是否在coffeescript中有一些项目

coffeescript中是否有一些方法在数组中包含一些项时返回true?像ruby中的方法一样present?:

[].present? false
[1].present? true
Run Code Online (Sandbox Code Playgroud)

根据http://arcturo.github.com/library/coffeescript/07_the_bad_parts.html,coffeescript中的数组空虚由其长度决定

alert("Empty Array")  unless [].length
Run Code Online (Sandbox Code Playgroud)

这对我来说似乎很蹩脚.

arrays coffeescript

13
推荐指数
2
解决办法
2万
查看次数

标签 统计

arrays ×1

coffeescript ×1