All you need is to use Array with width 5 and height 2 (for score and name) to keep high score and Localstorage to save array data.
Let's assume that you have 5 high scores and it saved on array, then you have another high score that need to be placed on 5th high score, just make an event to check if 5th value on Array.X number 5 is lower than your new high score, then set 5th value of array.X number 5 to your new high score, then do sort and reverse. It will automatically set your new high score to board.