["1001001:95", "1001002:100", "1001003:35", "1001004:37.5", "1001005:60", "1001006:100", "1001007:90", "1001008:140", "1001009:60", "1001010:90"]
How to operate an array elegantly, take out the numbers before and after the colon and match them together?
Sorry, I didn’t express it clearly;
I need to get the number after the colon, so I thought about it.
if(1001001) {
var value == 95
}
According to your if statement, if you simply want to get the value after the colon based on the id number before the colon, then you can use the indexOf method of the string plus the substr method to achieve this.
Array traversal, do one split for each element, and put the split elements into a new array.
I don’t know if I should do it this way. If I want to withdraw it at that time, I can just use the key to withdraw it
The page can be used directly
I wrote it like this. Can you guys see what’s wrong with this?