debugging what happens to data in js