Member-only story
The Most Horrible and Amazing Language: JavaScript!
Oh, pesky JavaScript! How has this language thrived? It has grown-up in the place that we now live … the browser. For most client-side things, it is the only show in town, especially as Flash and Microsoft (I forget it’s name) have both left the stage.
JavaScript is both amazing and absolutely terrible at the same time. And JSON objects? Ahhhh! For this, there’s one little line of code that is essential:
alert(myjson);
So, here’s a little tip I learnt today when debugging with Google Firebase. For this I received the following JSON object when the user uses a Twitter login:
{"user":{"uid":"vxfdsss","displayName":"Fred Smith","photoURL":"https://pbs.twimg.com/profile_images/777/7Nm_normal.jpg","email":null,"emailVerified":false,"phoneNumber":null,"isAnonymous":false,"tenantId":null,"providerData":[{"uid":"226900035","displayName":"Fred Smith","photoURL":"https://pbs.twimg.com/profile_images/777/7Nm_normal.jpg","email":"fred@home","phoneNumber":null,"providerId":"twitter.com"}],...
This contains their email address, photo and unique ID. So let’s unpick it:
{"user":{
"uid":"vxfdsss",
"displayName":"Fred Smith",
"photoURL":"https://pbs.twimg.com/profile_images/777/7Nm_normal.jpg",
"email":null,
"emailVerified":false…