Let me ask you a question about json

Asked 2 years ago, Updated 2 years ago, 35 views

I found out yesterday that it was json.It's based on the object grammar format of JavaScript, right?

But the book says json is a text-based data exchange format.

When json is expressed, it is called text-based

The properties and values are all String values. I thought it was all expressed in strings

I saw the API that receives json while watching the Java video earlier, and the attribute value received the int value.

So I thought that all the attribute values in json are not strings.

So what does text-based mean?;

I thought it was because all the attribute values were strings.

Text-based isn't literally the string of data types

I don't really understand if you're talking about the text itself like you're writing in a notepad.

It's a part of Json that I got confused with If you look at it, it's a cotton string, and there are int values, float values, etc., so in json,

I think it's expressed as a number value

Do I have to get it according to that data type when I get it?

I received json from Android today and parsed it.

I accidentally received the reservation_rate value as a string by mistake and set the data in the view

But it went well without any problems.

If there's nothing wrong with this...

Why do you have to write it by dividing it into string, number, object, etc.?

json

2022-09-20 19:38

1 Answers

https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/JSON <= Official Document

Text format is what you use to store values Parsing with actual values allows you to express most values except functions. Below is the JSON method.

JSON.stringify(obj); // Change object to JSON text
JSON.parse (JSONText); // Change JSON text to JavaScript object


2022-09-20 19:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.