【发布时间】:2020-01-10 15:14:33
【问题描述】:
我有以下对象:
system(1) 中的每个属性都包含三维坐标。有没有办法合并所有具有相同前缀的属性,而不必在另一个循环中编写循环?这就是我想要实现的目标:
// coordinates of points in systems with prefix lwb
setOfValidPoint1 = [[3.370316528, 0.050628689000000004, 0.20987313800000001],
[3.4050299070000003, 0.559079376, 0.267691772],
[2.990670776, 0.05074561700000001, 0.21216622899999998]]
// coordinates of points in systems with prefix lwb
setOfValidPoint2 = [[3.440000732, 0.04970323, 0.210814064],
[3.4748417970000003, 0.5596490780000001, 0.268024719]]
// coordinates of points in systems with prefix mrf (one point)
setOfValidPoint3 = [[3.51507, 0.777428, 0.36277]]
等等……
【问题讨论】:
-
请考虑编辑您的代码以构成minimal reproducible example,如How to Ask 中所述。特别是,请将相关代码作为文本而不是图像。
标签: arrays typescript object