testing js for km