# LuaJsonObject:new

The constructor for a `LuaJsonObject` object (creates a new `LuaJsonObject`).

If you do not specify any attributes to assign to the object (by omitting the `attributes` argument), an empty object is created.

## Syntax

    LuaJsonObject:new( [attributes] )

## Arguments

Argument | Description
--- | ---
`attributes` | (lua_json_object_type) A table of attributes (name/value pairs) to assign to the object. The keys in the table must be strings which specify the names of the attributes. Each value can be a Boolean, float, integer, string, LuaJsonObject, LuaJsonArray, LuaJsonValue, or nil. TIP: In Lua, keys in a table cannot be assigned the value of `nil`. If you want to have a null value (`nil` in Lua), you can do the following: `LuaJsonObject:new( { key=LuaJsonValue:new(nil) } )`.

## Returns

(LuaJsonObject). The new `LuaJsonObject` object.

## Example

The following is a simple JSON object:

    {"product":"IDOL","version":11}

To create a `LuaJsonObject` object to represent this JSON object:

    local myJsonObject = LuaJsonObject:new( { product="IDOL" , version=11 } )

© Copyright 2016-2020 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a mail client, and then send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm