In Flutter doc, it uses jsonEncode()
, while in Angular doc, it uses json.encode()
. What is the difference and preferred way between the two?
jsonEncode
as alias for json
was introduced because json
often collided with a varible name json
many used for the variable that holds the JSON value.
var json = http.get(...);
var data = json.decode(json); // error
var data = jsonDecode(json); // ok
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With