A simple implementation of turning a JS JSON object into a string

  • 2020-03-29 23:48:46
  • OfStack

Return / ^ (string | number) $/. Test typeof (s)? '" + s + "' : s;

Return /^(string)$/.test(typeof s)? '" + s + "' : s;

(just ignore the number type)


Related articles: