frank
06/27/2020, 11:41 AMturansky
06/27/2020, 12:07 PMfrank
06/27/2020, 12:23 PMturansky
06/27/2020, 12:28 PMturansky
06/27/2020, 12:28 PMandylamax
06/27/2020, 12:38 PMjson
function from kotlin.js
is almost similar to koson. How verbose is this?
val obj2 = json(
"one" to 1,
"three" to 3,
"map" to json(
))
frank
06/27/2020, 12:44 PMPair
inside of json ()
and it very verbose:
json(Pair("msg",item.textContent), Pair("type",type))
andylamax
06/27/2020, 12:46 PMjson(
"numbers" to json(
"integers" to arrayOf(1, 2, 3, 4, 5, 6, 7, 8),
"naturals" to arrayOf(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)
),
"characters" to arrayOf('A', 'B', 'C', 'D'),
"users" to arrayOf(
json(
"name" to "John Wick",
"weapon" to "book"
),
json(
"name" to "Thanos",
"weapon" to "Infinity Stones"
)
)
)
frank
06/27/2020, 12:57 PM[
{msg: "msg" },
{msg: "msg" }
]
I have to define Array<Json>
variable or there is some function or object that returns jsonArray?andylamax
06/27/2020, 1:03 PMarrayOf(
json("msg" to "msg"),
json("msg" to "msg")
)
frank
06/27/2020, 1:05 PMarrayOf(
json("msg" to "msg"),
json("msg" to "msg")
)Yes, I have seen that I am wrong and they are 2 json objects in array.
andylamax
06/27/2020, 1:05 PM