基本上在Javascript中执行`where`子句的最佳方法是什么? [英] Best way of basically doing a `where` clause in Javascript?
本文介绍了基本上在Javascript中执行`where`子句的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试解析发送给我的一些JSON,它的格式为
I'm trying to parse some JSON that is sent to me and it's all in the format of
[{key:value},{key2:value2}, ... ]
什么是最好的方法得到 key2
的值?有没有办法在不进行for循环的情况下完成它?
What would be the best way to get the value of key2
in this? Is there a way to do it without doing a for loop?
推荐答案
您可以使用从 Underscore.js 库中选择功能。
You could use the Select function from the Underscore.js library.
这篇关于基本上在Javascript中执行`where`子句的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文