Like mentioned in the comments, you had wrong indentation as well as some extra spaces and missing commas.
localStorage.setItem('gameState', '{"grid":{"size":4,"cells":[[{"position":{"x":0,"y":0},"value": 1024},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}},{"position":{"x":0, "y": 1}{"value":1024}}]]},"score":272,"over":false,"won":false,"keepPlaying ":false}');