JavaScript数组ID循环 [英] JavaScript array id loop

查看:59
本文介绍了JavaScript数组ID循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对JavaScript还是很陌生,遇到一种情况,我需要给JavaScript数组中的每个项目赋予唯一的ID.

I am quite new to JavaScript professionally and I have encountered a situation where I need to give every item in a JavaScript array a unique id.

该数组非常大,因此无法手动完成.有没有简单的方法可以做到这一点?每个简单的数字id都是极好的.这样PHP开发人员可以轻松地操纵数组,这就是他要求完成的方式.

The array is very large so it cannot be done manually. Is there a simple way to do this? A simple numerical id for each would be superb. It is so that a PHP developer can easily manipulate the array and this is how he has requested it be done.

推荐答案

JS中的数组确实具有唯一的ID(即其索引值).

Arrays in JS do have unique IDs - its index value.

这篇关于JavaScript数组ID循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆