Json stringify map

You can't directly stringify the Map instance as it doesn't have any properties, but you can convert it to an array of tuples: jsonText = JSON.stringify (Array.from (map.entries ())); For the reverse, use. map = new Map (JSON.parse (jsonText)); Share do you JSON.stringify an ES6 Map Given your example is a simple use case in which keys are going to be simple types, I think this is the easiest way to JSON stringify a Map. Method 1. Both JSON.stringify and JSON.parse support a second argument. replacer and reviver respectively Both JSON.stringify and JSON.parse support a second argument. replacer and reviver respectively. With replacer and reviver below it's possible to add support for native Map object, including deeply nested value JavaScript - Convert Map to JSON String To convert a map to JSON string in JavaScript, convert map to JavaScript object using Object.fromEntries() and then pass this object as argument to JSON.stringify() method. Syntax A quick syntax to convert a Map map into JSON String is Examples In the following example, we take a Map map and convert this Map to JSON string using Object.fromEntries. Solved! Go to Solution. 10-02-2013 09:35 PM. The print task parses the map object manually to create a JSON object that matches the ExportWebMap specification to use Print GP Services. So you can do the same, but you'd need to step through the map object, JSON.stringify () won't do it. 10-02-2013 09:35 PM

javascript - How do you JSON

Convert Map into JSON object using Iterate and Stringify method. First. Map is created with key and values of type strings. map.forEach method is used iterate the map which contains callback called for every element of Map. Object created and added keys and values. Finally, Object is returned in JSON format using JSON.stringify () method JSON.stringify() converts a value to JSON notation representing it: If the value has a toJSON() method, it's responsible to define what data will be serialized.; Boolean, Number, and String objects are converted to the corresponding primitive values during stringification, in accord with the traditional conversion semantics.; undefined, Functions, and Symbols are not valid JSON values JSON.stringify()无法转化ES6中map数据问题 今天在开发中遇到了一个奇怪的问题,小编要记录一下。今天小编开发中看到项目以前用 JSON.stringify(this.defectBaseData3)==={} 为空对象的判断,结果小编调试的时候发现this.defectBaseData数组超大的时候*JSON.stringify(this.defectBaseData3)==={}*也为true,弄的小编怀疑. JSON.stringify() As name suggests, the JSON.stringify() function transforms a JavaScript object into a JSON string. While sending JSON data from a client to a server, it must be converted into a JSON string. JSON.stringify() can also take two more optional parameters: replacer - either a function or an array to manipulate the result Use the JavaScript function JSON.stringify () to convert it into a string. const myJSON = JSON.stringify(obj); The result will be a string following the JSON notation. myJSON is now a string, and ready to be sent to a server: Example. const obj = {name: John, age: 30, city: New York}; const myJSON = JSON.stringify(obj)

How do you JSON.stringify an ES6 Map? - Flutter

  1. JSON.stringify with mapped variables Posted by Nelson on February 6, 2012 Leave a comment (6) Go to comments There are times when I want to create a data structure in Mirth, and output the contents of that data structure while debugging the code
  2. In Jackson, we can use mapper.readValue(json, Map.class) to convert a JSON string to a Map. P.S Tested with Jackson 2.9.
  3. json-source-map. Parse/stringify JSON and provide source-map for JSON-pointers to all nodes. NEW: supports BigInt, Maps, Sets and Typed arrays. Instal
  4. In this article. Configuration. Data flow script. Next steps. APPLIES TO: Azure Data Factory Azure Synapse Analytics. Use the stringify transformation to turn complex data types into strings. This can be very useful when you need to store or send column data as a single string entity that may originate as a structure, map, or array type

JSON: chapter Creating and parsing JSON of JavaScript for impatient programmers Arbitrary Maps as JSON via Arrays of pairs # If a Map contains arbitrary (JSON-compatible) data, we can convert it to JSON by encoding it as an Array of key-value pairs (2-element Arrays). Converting a Map to and from an Array of pairs JSON stringify. A simple JSON stringify function which requires Array.prototype.map method. Contributors. The following users provided lots of ideas and improvements of the code

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more How to stringify JSON with JSON.stringify() in Node.js. Finally, if you're parsing JSON with Node.js, there's a good chance that you'll need to return JSON at some point, maybe as an API response. Luckily, this works the same way as in the browser - just use JSON.stringify() to convert JavaScript object literals or arrays into a JSON string 因为map的key可以为任何类型, 包括对象. 但是JSON语法, key只能为string. 所以不能直接对JSON.stringify(Map). 1.但是可以先把map转换为一个array jsonText = JSON.stringify(Array.from(map.entries())); 2. 或转换为Javascript Object const mapToObj =.


json_stringify. With this function you can convert single or nested structs and arrays into a valid JSON string. You supply the initial value to use (an array index or a struct reference) and then the function will stringify it, converting it into a JSON string, converting GameMaker arrays into JSON arrays, and GameMaker structs in to JSON objects JSON.stringify() konvertiert einen Wert in einen in JSON-Notation gleichwertigen Wert: Wenn der Wert eine toJSON() Methode hat, definiert diese, welche Daten serialisiert werden.; Boolean, Number und String Objekte werden zu den entsprechenden primitiven Werten, gemäß der traditionellen Konvertierungssemantik, konvertiert.; Wenn undefined, eine Funktion oder ein Symbol während der. JSON.stringify doesn't know what to do with those int fields. So, it drops them. When I would run. JSON.stringify(example_list) I would be returned this: [] And it drove me insane! Because I knew the array had fields in it. But I wasn't paying enough attention (I know, I know 最近在看《你所不知道的javascript》[中卷]一书,第一部分是类型和语法。本文是基于这部分的产物。在强制类型转换->抽象值操作-> toString 部分,其中对工具函数 JSON.stringify(..) 将 JSON 对象序列化为字符串部分介绍进行了详细的介绍,而自己之前对 JSON.stringify(.. Good to know about Map and Set behavior with JSON.stringify() and good is every article about 2 other arguments since very few people knowing about it and using it :-) I am using mainly 3rd argument for some months and mainly for printing arrays for debug or some export, since it works for arrays the same way it works for objects

MapをJSONにしたい! JSON.stringify()を使えばええやん。 つまり、map→array→jsonと変換されるわけですな JSON supports plain objects, arrays, strings, numbers, booleans, and null. JavaScript provides methods JSON.stringify to serialize into JSON and JSON.parse to read from JSON. Both methods support transformer functions for smart reading/writing. If an object has toJSON, then it is called by JSON.stringify 객체 안 멤버들을 하나씩 돌아가면서 Map이거나 오브젝트인지 확인한다. Map이면은 JSON stringify 할 수 있는 Array로 변환한다. 오브젝트이면 중첩되어있는 Map을 찾기 위해 재귀적으로 반복한다. 사용법. myObject 와 같은 중첩 map을 포함하고 있고, 포함되어있는 Map이 Map. # JSON.parse와 JSON.stringify (JavaScript) 하나의 파라메터에 다수의 데이터를 담고 싶을때 Map 또는 List를 사용할 수 있는데 종종 구성된 로직에 따라, 환경에 따라 Map과 List를 사용할 수 없는 경우가.

Low Prices on Json You can't directly stringify the Map instance as it doesn't have any properties, but you can convert it to an array of tuples: jsonText = JSON.stringify(Array.from(map.entries())); For the reverse, use. map = new Map(JSON.parse(jsonText)); You can't. The keys of a map can be anything, including objects. But JSON syntax only allows strings as keys So I have a Map object to store data like 'ContentTypes': '['id':1, 'name':'test', etc...]', with key and value both being strings. How can I 1 Solution. 10-02-2013 09:35 PM. The print task parses the map object manually to create a JSON object that matches the ExportWebMap specification to use Print GP Services. So you can do the same, but you'd need to step through the map object, JSON.stringify () won't do it

While sending JSON data from a client to a server, it must be converted into a JSON string. As we know, JSON is usually helping us exchanging the data from the client-side to a remote server. JavaScript provides two methods to work with JSON content. JSON is a syntax for serializing objects, arrays, numbers, strings, booleans, and null. For the example to follow, we will map a single PERSON. JSON stringify method - de valfria parametrarna Jag skulle vilja börja använda ES6 Map istället för JS-objekt men jag håller tillbaka eftersom jag inte kan räkna ut hur jag JSON.stringify () en karta Nov 30, 2019 · To convert a JSON string stored in a file into a Java map, you can pass an instance of Reader to fromJson(), as shown below: Map < String , Object > map = new Gson ( ) . fromJson ( new FileReader ( user.json ) , Map . class ) 1. Convert JSON-String To Map Source) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 package com.source. Deserialization In order to deserialize what we have above, we can use the second argument to JSON.parse(). (I bet most people didn't know it has a second argument) This is called the reviver, and it's job is to do basically the opposite of the replacer above.. Here we'll test for the type and shape of the value to see that it matches a bunch of numbers followed by an n

Syntax. The syntax to call JSON.stringify() method with array arr passed as argument is. JSON.stringify(arr) stringify() returns a string value. Examples. In the following example, we take an array arr with strings as elements and convert this array to JSON string using JSON.stringify() method.. index.htm JSON.stringify() can take two additional arguments, the first one being a replacer function and the second a String or Number value to use as a space in the returned string. The replacer function can be used to filter out values, as any value returned as undefined will be out of the returned string JSON stringification is the process of converting a Javascript object to a flat JSON string that can be used inside a program. In Javascript, the standard way to do this is by using the method JSON.stringify(), as the Javascript standard specifies.. JSON.stringify() is the opposite of JSON.parse(), which converts JSON into Javascript objects.. This article and Udacity's JSON.parse() article. you can get JSON from engine by. ScriptObjectMirror json = (ScriptObjectMirror) engine.eval (JSON); and call it's parse or stringify method via: json.callMember (stringify, object); json.callMember (parse, str) Share. Improve this answer. Follow this answer to receive notifications. answered Jul 8 '15 at 13:58

The syntax of the JQuery JSON stringify() method - JSON.stringify(value, replacer, space); Parameters. value - This is not an optional parameter that specifies the value or object which is to be converted into the JSON string.; replacer - This is an optional parameter that specifies the array or the altering function uses as a selected filter for the stringify How do you JSON.stringify an ES6 Map? - ytukyg.blogspot.com 56 5. json stringify vs array map + join (version: 0) Comparing performance of: map + join vs JSON.stringify Created: 3 months ago by: Guest Jump to the latest resul The JSON.stringify() function lets us convert objects to strings. To do the opposite, we'll look at the JSON.parse() function. JSON.parse() Strings are useful for transporting but you'll want to be able to convert them back to a JSON object on the client and/or the server side. We can do this using the JSON.parse() function

map allows me to write single-responsibility functions that only understand values and index and operate on the lazily-evaluated values of the generator. I realized that the json.stream could be a generator that takes the result of pipe ing the other functions, which means it can come last in the pipe JSON格式化,JSON.stringify ()的用法. 一般来说,系列化后的结果是通过键值对来进行表示的。. 如果此时replacer的值在value中存在,那么就以replacer的值做key,json的值为value进行表示,如果不存在,就忽略。. 方法时,就是说把系列化后json的每一个对象传进方法里面. Objects are not valid React elements, however, strings are. If we transform an object using JSON.stringify () into a string, we can render it just as we would any other string. We can encapsulate this concern in a React component. We can then use this component in a React app wherever we might like to display an object on the screen ES6中的Map与JSON的相互转化(序列和持久化). 当你需要存一些键值对数据时,然后你不知道key是哪些对象类型。. 你最好把他们存在Map中,这比存在Object中好些。. 注* Map支持任意类型如Object作为key; 目前JSON.stringify和JSON.parse并不支持Map;. 1. 将Map对象转化成为二维. A few days ago, someone asked me how to parse JSON data coming from API requests using Angular applications. So, I thought of writing a solution for those who want a simple solution without crawling through many links on Google

Simplifying Development with OpenROAD JSON-RPC - ActianLeave a Reply Cancel reply

How do you JSON.stringify an ES6 Map? - JavaScrip

How to Convert Map to JSON String in JavaScript

Most of the modern APIs using JSON formats as output. That's why the JSON is becoming popular data format for the API's output. JavaScript provides two methods to work with JSON content. parse and stringify. The methods are JSON.parse() and JSON.stringify(). JSON.parse() method takes JSON string and transforms it into a JavaScript object JSON.stringify() 将 JSON 对象序列化为字符串时也用到了 toString,对大多数简单值来说,JSON 字符串化和 toString() 的效果基本相同,只不过序列化的结果总是字符串。JSON.stringify()在对象中遇到 undefined 、 function 和 symbol 时会自动将其忽略,在数组中则会返回 null {widget: { debug: on, window: { title: Sample Konfabulator Widget, name: main_window, width: 500, height: 500 }, image: { src: Images/Sun.png. json-ext. A set of utilities that extend the use of JSON. Designed to be fast and memory efficient. Features: [x] parseChunked() - Parse JSON that comes by chunks (e.g. FS readable stream or fetch response stream) [x] stringifyStream() - Stringify stream (Node.js) [x] stringifyInfo() - Get estimated size and other facts of JSON.stringify() without converting a value to strin

파서 만들기 (1) - JSON.stringify. February 11, 2020. 프로그래밍을 하다보면 규칙을 가진 문자열에서 필요한 형태로 가공해야할 때가 있습니다. 간단하게는 URL에서 부터 복잡하게는 XML, JSON 등이 있습니다. 다른사람들도 다 사용하고 있는 표준화된 경우 라이브러리를. The JSON.stringify() function comes with a few limitations that make it a lackluster choice for checking deep equality. First, key order matters: const o1 = { question: null, answer: 42}; const o2 = { answer: 42, question: null}; JSON.stringify(o1) === JSON.stringify(o2); // false. Second, not all types are representable in JSON JSON Processing. The Java API for JSON Processing ( JSR 353) provides portable APIs to parse, generate, transform, and query JSON using object model and streaming APIs. The object model API creates a random-access, tree-like structure that represents the JSON data in memory. The tree can then be navigated and queried JSON.stringify 方法是将一个 JavaScript 对象或值转换为 JSON 字符串,默认该方法其实有三个参数:第一个参数是必选,后面两个是可选参数非必选。. 第一个参数传入的是要转换的对象;第二个是一个 replacer 函数,比如指定的 replacer 是数组,则可选择性地仅处理包含.

Replacer Function. The 2nd argument to JSON.stringify () is a replacer function. JavaScript calls this function for every key/value pair in the object, and uses the return value. If the replacer function returns undefined, that key is omitted from the JSON output. For example, suppose you wanted to strip out null values using a replacer function JSON.stringifyって便利ですよね。 簡単に成形できていい感じです。 json.js var obj = { a: 1, b: Moji, c: [1, 2, 3, 4],. JSON.stringify () 可以带两个额外的参数,第一个是替换函数,第二个间隔字符串,用作隔开返回字符串。. 参数:. value : 将要转为JSON字符串的javascript对象。. replacer :该参数可以是多种类型,如果是一个函数,则它可以改变一个javascript对象在字符串化过程中的行为. json-rust. Parse and serialize JSON with ease. Changelog-Complete Documentation-Cargo-Repository. Why? JSON is a very loose format where anything goes - arrays can hold mixed types, object keys can change types between API calls or not include some keys under some conditions. Mapping that to idiomatic Rust structs introduces friction

Solved: JSON.stringify esri.map object - Esri Communit

json: JSON string - stringified data. pointers: an object where each key is a JSON-pointer, each corresponding value is a mapping object (same format as in parse method). Comparison with the standard JSON.stringify: replacer parameter of JSON.stringify is not supported, but its position is reserved JavaScript JSON APIs/Methods Guide. 1. Overview. The JSON object contains methods for parsing JavaScript Object Notation (JSON) and converting values to JSON. JSON is a syntax for serializing objects, arrays, numbers, strings, booleans, and null. It is based upon JavaScript syntax but is distinct from it: some JavaScript is not JSON JSON.stringify() 九大特性 JSON.stringify()第一大特性 对于 undefined、任意的函数以及 symbol 三个特殊的值分别作为对象属性的值、数组元素、单独的值时 JSON.stringify()将返回不同的结果。. 首先,我们来复习一下知识点,看一道非常简单的面试题目:请问下面代码会输出什么

Reading Driver’s License Information from PDF417 in

深入 JSON.stringify,基本知识以下信息来自MDN,相对全面易懂定义JSON.stringify()方法将一个JavaScript对象或值转换为JSON字符串,如果指定了一个replacer函数,则可以选择性地替换值,或者指定的replacer是数组,则可选择性地仅包含数组指定的属性。语法JSON.stringify(value[,replacer[,space]])复制代码参数va Vue.js JSON stringify- We can use native JavaScript JSON stringify() method to convert json object to json string. Here in this tutorial, we are going to explain how you can use this method to convert an json object to json string in JavaScript in vuejs. You can also use our online editor to edit and run the code online 排序对象属性和JSON.stringify. 94. 我的应用程序具有大量对象,我将它们进行字符串化并将其保存到磁盘。. 不幸的是,当数组中的对象被操纵并且有时被替换时,对象上的属性以不同的顺序列出(它们的创建顺序?. )。. 当我在数组上执行JSON.stringify()并将其.

json字符串转化成json对象 // jquery的方法 var jsonObj = $.parseJSON(jsonStr) //js 的方法 var jsonObj = JSON.parse(jsonStr) json对象转化成json字符串 //js方法 var jsonStr1 = JSON.stringify(jsonObj) json对象和json字符串之间的相互转换 例一:比如我有两个变量,我要将a转换成字符串,将b转换成JSON对象: var a={name:& Having the data in the string form is crucial. So this conversion of Arrays or Objects into a string is carried out efficiently by JSON.stringify() function. Understand JSON.stringify() Syntax JSON. stringify (value, replacer, space) Let's take a look at the 3 parameters accepted by JSON.stringify() The JSON.stringify () function, as name suggests, converts a JavaScript value to a serialized JSON string. JSON.stringify () can optionally use a replacer function to replace values using custom logic. 1. Syntax. The syntax of the JSON.stringify () method is: JSON.stringify(value[, replacer[, space]]) 1.1. Method Parameters

javascript map nested object Code ExampleFirstport ®: Women&#39;s & Men&#39;s Luxury Fashion | First Port

Typescript - How to convert Map to/from JSON with examples

JSON.stringify() can take additional arguments, a replacer function and a string or number to use as a space in the returned string. That means the replacer argument can be used to filter out values if you return undefined, as shown in the following example As we know, JSON is usually helping us exchanging the data from the client-side to a remote server. So, when we have the JavaScript data in the Object form, it has to be in the string form to be sent to the webserver. Exactly that is where JSON.stringify() method comes in handy, It converts JavaScript simple or complex objects into a JSON string この記事では「 【JavaScript入門】JSON.stringifyについて徹底解説 」といった内容について、誰でも理解できるように解説します。この記事を読めば、あなたの悩みが解決するだけじゃなく、新たな気付きも発見できることでしょう。お悩みの方はぜひご一読ください JSON.stringify () 方法是将一个JavaScript值 (对象或者数组)转换为一个 JSON字符串,如果指定了replacer是一个函数,则可以选择性的替换值,或者如果指定了replacer是一个数组,可选择性的仅包含数组指定的属性。. 本文要实现的 JSON.stringfy () 是不带 replacer 和 space 参数.

Simply create the following file in your project and when you use JSON.stringify it will return a Stringified<T> which will preserve the original type for you when you call JSON.parse again. It works by extending the String typ e and adding a private __stringified: T field, only TypeScript can see this (it won't appear in intellisense) and is. First called array map () method is call a function for every element during iteration and return a new array for each element. Create an Object with this values in map chain to return new array Next step deep copy the array of object to new object. Convert this object to JSON string using JSON.stringify () method . Output is same for this code

MU DVB-T2 USB IPTV Box TV Smart stick Dongle TV: Amazon

JSON.stringify() - JavaScript MD

JSON.stringify ES6 Map_金溪的博客-CSDN博客_json.stringify ma

Understanding JSON.parse() and JSON.stringify(

JSON Viewer. JSON Viewer Online helps to Edit, View, Analyse JSON data along with formatting JSON data. It's very simple and easy way to Edit JSON Data and Share with others. This is also a JSON file Viewer. Upload JSON file, Upload url of JSON and view in Tree Structure. This is also a JSON visualizer tool to visualize, Search JSON in Tree View 1.json数据 转 字符串 JSON.stringify(jsondata) 2.字符串 转 JSON JSON.parse(str) 3.Map 转 JSON,需要先将Map转化为Object(对象) function strMapToObj(strMap){ let obj= Object.create(nul..

ERITIA (Cadice): AGGIORNATO 2021 - tutto quello che c&#39;è da

json-key-map v1.0.0. A module for mapping between JSON keys and values. NPM. README. GitHub. MIT. This post shows a couple of new tricks and ways to properly leverage the hidden capabilities of JSON.stringify covering: JSON expectations and non-serializable data formats, How to use toJSON() to define objects properly for JSON serialization, The replacer option for filtering out values dynamically, the spaceparameter for formatting JSON output

JSON.stringify() - W3School

JSON.stringify(val): need to convert small non-nested object .toString(radix): convert number to hexidecimal or binary @frontendr : Carefully when using JSON.stringify, that will change a string. generate TypeScript interfaces from JSON email; feedback; help; generate TypeScrip 가독성을 뛰어나게 해줄 수 있는 방법이 있습니다. 바로 JSON.stringify () 의 replace 와 space 파라미터를 활용 하는 방법입니다. 더 정확하게는 replace 는 사용하지 않고 space 를 잘 이용하는 방법입니다. replacer 에 null (사용하지 않습니다) 을 space 에 2를 입력했습니다. 我正在开发一个Angular应用程序。 我使用Typescript,并且有一个包含内置Set和Map类型的特定类。 我的问题是我想将类的实例作为JSON存储在浏览器的localStorage中,但是当我尝试对它们进行字符串化时,会得到这些类型的空字符串

JSON.stringify with mapped variables NelsonWells.ne

JSON.stringify() 方法将一个 JavaScript 对象或值转换为 JSON 字符串,如果指定了一个 replacer 函数,则可以选择性地替换值,或者指定的 replacer 是数组,则可选择性地仅包含数组指定的属性。 语法 JSON.stringify(value[, replacer [, space]]) 复制代码 复制代码 参数 valu 멀쩡한 json데이터를 JSON.stringify를 이용하여 String으로 형변환을 하고 있습니다. 당연히 컨트롤러는 String타입의 데이터를 받게 되며 이때 전달한 String데이터는 JSON형태로 이루어진 데이터임을 알려주기위하여 contentType 속성값을 application/json로 지정하는 것입니다 Using JSON.stringify and JSON.parse¶ A deep copy takes place when you copy an object with the objects to which it refers. You can do it by applying the mixture of JSON.stringify and JSON.parse for creating a deep copy. First of all you, should JSON.stringify() the json object parsing it to get the objec

Evangelical Leaders Seek To Insulate Churches From Some

json wcfサービスに連想配列を渡したいと思います。 json wcfサービスにjavascriptマップを渡す. var map = { }; map['a'] = 1; map['b'] = 2; map['c'] = 3; そして、私のWCFサービスで. は、私が辞書を期待したい:だから、JavaScriptで 私はこれに似た何かを持ってい let data = JSON.stringify(new User(Steve, 39)); let user = User.fromJSON(JSON.parse(data)); This is good, but we can do better. JSON.parse accepts a second parameter called reviver which is a function that gets called with every key/value pair in th javascript map to json string Read More. POSSIBLE REASONS BEHIND STUDENT VISA REJECTION Read More. GMAT coaching in Chandigarh/Punjab Read More. Studying in Australia, immigration consultants in Chandigarh Read More. Things You Need to Know About Canadian Education. Ajax에서 JSON배열을 컨트롤러 전송. Ajax에서 데이터를 컨트롤러로 전송하는 방법중 배열(array) 데이터를 컨트롤러로 보내서 처리해야할 때가 자주 있습니다. 단 일 데이터가 아닌 JSON형태의 그것도 배열이 담. java Arraylist转json 对象转json,引入相关包,这里使用的包是net.sf.json-lib:json-lib:2.4,但是引入的时候有点坑,这个包有两个版本,jdk1.5和jdk1.4的,引入的时候要加入相应的jdk版本号,否则不能引入成功.这里使用的是gradle,所以在dependencies里添加一行compilenet.sf.json-lib:json-lib:2.4:jdk15如果写成 compil Phương thức JSON.stringify(obj) được sử dụng để chuyển đổi obj thành một String. Nếu đối tượng obj có phương thức toJSON() phương thức này sẽ được gọi để trả về String, ngược lại nó sẽ chuyển đổi theo quy tắc mặc định