Json.stringify problem

var a = {

b(){
    consoel.log(1);
}

}
json.stringify (a);

/ / a = {}

what if I want him to keep the function b and change the string?

Jun.30,2021

clipboard.png


clipboard.png


var a = {
    b() {
        consoel.log(1);
    }
}
console.log(a['b'] + '');

perfect


function is not a valid JSON data type. If you want to keep it, you can force toString to convert

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5a703-455b5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5a703-455b5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?