number pairs in javascript