Building clean JSON strings that can be parsed in JavaScript

Certain tasks required dynamically building JSON strings that are then parsed, transmitted and used in other media of different languages. This is usually encountered when coding products using multi-language stacks for instance when building APIs.

Building and consuming JSON within JavaScript is very easy as the convention belongs to the scripting language and lot of extra delimiters, missing quotes are forgiven when parsing the string. JavaScript converts string to object using the parse() method and converts JSON objects to string using the method

// parse a string into JSON
  let jsonObject = JSON.parse(jsonString)

  // convert object to string
  let jsonString = JSON.stringify(jsonObject)

However, problems arise when it is required to construct JSON objects on a different medium other than JS and then transmit the string to JS. The aim of this article is to define a convention for constructing JSON string in any language that will be used in JavaScript.

more    0 likes

BlinkWiki has Night Mode

I originally developed this website using the Svbtle homepage or dcurtis theme – black text on white background with an emphasis on large clear fonts. I have been fascinated with dark themes since its popularity in early 2010s. So I added a Night Mode modification to this site. To activate it, simply click on sun on the top right corner. The files used in this exercise are available on the BlinkWiki Github.

more    0 likes

Learning by Need:

I have been learning and I never stopped. The following charts my history of software development:

more    0 likes