Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

15
Task/JSON/Kotlin/json.kts Normal file
View file

@ -0,0 +1,15 @@
// version 1.2.21
data class JsonObject(val foo: Int, val bar: Array<String>)
data class JsonObject2(val ocean: String, val blue: Array<Int>)
fun main(args: Array<String>) {
// JSON to object
val data: JsonObject = JSON.parse("""{ "foo": 1, "bar": ["10", "apples"] }""")
println(JSON.stringify(data))
// object to JSON
val data2 = JsonObject2("water", arrayOf(1, 2))
println(JSON.stringify(data2))
}