[英]How do I get total number of columns received in RestAPI response?
You can simply access the .length
property on the array您可以简单地访问数组上的.length
属性
value={data?.body?.marketState?.length}
For more info about .length
:有关.length
的更多信息:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/length
For more information about JavaScript arrays in general:有关 JavaScript arrays 的更多信息:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.