Member-only story

The Most Horrible and Amazing Language: JavaScript!

Prof Bill Buchanan OBE FRSE
2 min readAug 31, 2020

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…

--

--

Prof Bill Buchanan OBE FRSE
Prof Bill Buchanan OBE FRSE

Written by Prof Bill Buchanan OBE FRSE

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.

No responses yet