【发布时间】:2015-12-18 07:16:15
【问题描述】:
我有一系列书名,还有一个有相应的书名。让我们假设我需要它们在单独的数组中,而不是在同一个字典中。如何重新排序两个数组的索引,同时确保数组 2 的索引仍然对应于数组 1 的索引?
//This is what I currently have:
var arrayOne = ["one", "two", "three", "four"]
var arrayTwo = [1, 2, 3, 4]
//The new indexes should be random, non-repeating integers
arrayOne = ["four", "two", "three", "one"]
arrayTwo = [4, 2, 3, 1]
【问题讨论】:
-
请edit您的帖子显示您为解决此问题而编写的一些代码
-
@SunilChauhan 因为我希望新订单是随机的