Javascript Json Loop Key Detector