[datatype] [fix] use var in for loop of keys and values functions