Mc Samuel
Mc Samuel
CC#
Created by Yelnats on 1/29/2024 in #help
How can I convert null entries in JSON data to a default value?
Or you get the info,.. Replace the null values then serialize it to your format of choice or back to JSON, since there is a need to replace the null values either way
21 replies
CC#
Created by Yelnats on 1/29/2024 in #help
How can I convert null entries in JSON data to a default value?
I haven't used annotations in JS yet... And for serialization are you using another library which isn't the JSON library or maybe the app requires a mandatory serialization to another format of sort
21 replies
CC#
Created by Yelnats on 1/29/2024 in #help
How can I convert null entries in JSON data to a default value?
Or pass it to gpt then kinda see if it's regurgitated poop is useful or just straight up garbage
21 replies
CC#
Created by Yelnats on 1/29/2024 in #help
How can I convert null entries in JSON data to a default value?
Mmmmmmm.... I'm honestly not well vexed in those unfortunately... I just do simple stuff rn..... Maybe you can check on stack overflow or something like that..
21 replies
CC#
Created by Yelnats on 1/29/2024 in #help
How can I convert null entries in JSON data to a default value?
But since editing the whole data might take a longer time if you only use a portion of it in practice ... Then i guess you can keep a "defaults object" to use when it's time to render the object in need so your code ends up checking the nulls then replacing from the "defaults object" properties
21 replies
CC#
Created by Yelnats on 1/29/2024 in #help
How can I convert null entries in JSON data to a default value?
Ooh i see,... So i guess u can, get the data, edit it using the null check then use it as you want
21 replies
CC#
Created by Yelnats on 1/29/2024 in #help
How can I convert null entries in JSON data to a default value?
Ooh, alright alright... Then i guess you can use the null check when inserting into the data.
21 replies
CC#
Created by Yelnats on 1/29/2024 in #help
How can I convert null entries in JSON data to a default value?
Do you want to edit the data or you want to display it, then use defaults when passing through null values
21 replies
CC#
Created by Yelnats on 1/29/2024 in #help
How can I convert null entries in JSON data to a default value?
Im assuming you want to null check when displaying data then keep the json data as is without affecting it, since you might want to use it somewhere else or just to keep it's original integrity
21 replies
CC#
Created by Yelnats on 1/29/2024 in #help
How can I convert null entries in JSON data to a default value?
If you want it to be a non-null vallue when displaying you can use the null check i think.. Check this [link from Mozilla] (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing)
21 replies