Sample code for 30+ languages & platforms
React Native

Create JSON Array of Strings

See more JSON Examples

Demonstrates how to create a JSON array of strings.

Chilkat React Native Downloads

React Native
import { JsonArray } from '@chilkat/react-native'

function chilkatExample() {
  // The goal of this example is to produce this:

  // [
  //   "tag1",
  //   "tag2",
  //   "tag3"
  // ]

  const jarr = new JsonArray();
  jarr.addStringAt(-1, 'tag1');
  jarr.addStringAt(-1, 'tag2');
  jarr.addStringAt(-1, 'tag3');

  jarr.emitCompact = false;
  console.log(jarr.emit());
}