当前位置: 首页 > news >正文

南昌网站建设电话营销最好的方法

南昌网站建设电话,营销最好的方法,上线了怎么做网站,电子商务网站建设策划书目录 JSON.stringify 简介 主要用途: API 实践1: 实践2: JSON.parse 简介 API 实践1 实践2 JSON.stringify 简介 用于把JavaScript对象、数组、值、布尔值等序列化成字符串形式。 主要用途: 得到的数据通常有以下主…

目录

JSON.stringify

简介

主要用途:

API

实践1:

实践2:

JSON.parse

简介

API

实践1

实践2


JSON.stringify

简介

用于把JavaScript对象、数组、值、布尔值等序列化成字符串形式。

主要用途:

得到的数据通常有以下主要用途:

数据传输:在客户端和服务器之间传递数据时,通常需要把数据序列化为字符串进行传输。JSON是一种常见的数据交换格式,而JSON.stringify 可以很方便的将javascript 的对象等数据转换成JSON字符串,以便在网络上传输。

本地存储: 在浏览器端,localStoragesessionStorage 存储的数据必须是字符串形式。JSON.stringify 可以用来将 JavaScript 对象转为字符串,以便在本地存储中使用。

保存数据: 将数据存储到本地文件或数据库时,经常需要将数据转为字符串形式。JSON 格式的字符串是一个通用的选择,而 JSON.stringify 可以用来生成符合标准的 JSON 字符串。

JSON.stringify() - JavaScript | MDN

API

JSON.stringify(value: any, replacer?: (string | number)[] | null | undefined, space?: string | number | undefined): string

实践1:

const data = {key1: 'value1',key2: 'value2',key3: {subKey1: 'subValue1',subKey2: 'subValue2'}
};
//改变内容,把所有的value值变为大写
const jsonString = JSON.stringify(data, (key, value) => {// 使用 replacer 函数,将所有字符串值转为大写if (typeof value === 'string') {return value.toUpperCase();}return value;
}, 2);  // 使用缩进为2的空格console.log(jsonString);

实践2:

const data = {key1: 'value1',key2: 'value2',key3: {subKey1: 'subValue1',subKey2: 'subValue2'}
};//不改变内容,缩进4空格,便于阅读
const jsonString = JSON.stringify(data, null, 4);  // 使用缩进为4的空格console.log(jsonString);

JSON.parse

简介

将JSON的字符串转换为 JavaScript的 对象。需要注意 必现符合JSON字符串格式的数据才行。

JSON.parse() - JavaScript | MDN

API

JSON.parse(text: string, reviver?: ((this: any, key: string, value: any) => any) | undefined): any

实践1

const jsonString = '{"name": "John", "age": 30, "city": "New York"}';const reviver = (key, value) => {// 将 age 属性的值加倍if (key === 'age') {return value * 2;}return value;
};const parsedObject = JSON.parse(jsonString, reviver);console.log(parsedObject);
// 输出: { name: 'John', age: 60, city: 'New York' }

实践2

const jsonString = '{"name": "John", "age": 30, "city": "New York"}';const parsedObject = JSON.parse(jsonString);console.log(parsedObject);
// 输出: { name: 'John', age: 30, city: 'New York' }


文章转载自:
http://johannes.rnds.cn
http://tia.rnds.cn
http://septuagenarian.rnds.cn
http://melanesian.rnds.cn
http://jezail.rnds.cn
http://stab.rnds.cn
http://pood.rnds.cn
http://imbecility.rnds.cn
http://multeity.rnds.cn
http://aleph.rnds.cn
http://galactopoietic.rnds.cn
http://wye.rnds.cn
http://biogenic.rnds.cn
http://zamindari.rnds.cn
http://ophthalmotomy.rnds.cn
http://anesthetize.rnds.cn
http://countryman.rnds.cn
http://koala.rnds.cn
http://longheaded.rnds.cn
http://halophyte.rnds.cn
http://vivid.rnds.cn
http://aproposity.rnds.cn
http://september.rnds.cn
http://armorica.rnds.cn
http://westpolitik.rnds.cn
http://gustavus.rnds.cn
http://nonvocoid.rnds.cn
http://zoneless.rnds.cn
http://pearson.rnds.cn
http://prosciutto.rnds.cn
http://symbolistic.rnds.cn
http://dishorn.rnds.cn
http://costume.rnds.cn
http://credal.rnds.cn
http://tensimeter.rnds.cn
http://tachinid.rnds.cn
http://bonism.rnds.cn
http://aten.rnds.cn
http://actionist.rnds.cn
http://allocator.rnds.cn
http://indexed.rnds.cn
http://macrencephalia.rnds.cn
http://calabazilla.rnds.cn
http://interpretable.rnds.cn
http://arthrotropic.rnds.cn
http://secko.rnds.cn
http://schoolfellow.rnds.cn
http://priming.rnds.cn
http://madonna.rnds.cn
http://naggish.rnds.cn
http://ministerial.rnds.cn
http://hyperspatial.rnds.cn
http://jeux.rnds.cn
http://geelong.rnds.cn
http://feebleness.rnds.cn
http://hexavalent.rnds.cn
http://aphylly.rnds.cn
http://subgenital.rnds.cn
http://likely.rnds.cn
http://starless.rnds.cn
http://fascicled.rnds.cn
http://mortification.rnds.cn
http://curarize.rnds.cn
http://extrauterine.rnds.cn
http://roughride.rnds.cn
http://antimilitarism.rnds.cn
http://osmidrosis.rnds.cn
http://saltpetre.rnds.cn
http://dosage.rnds.cn
http://shenzhen.rnds.cn
http://curiousness.rnds.cn
http://laciness.rnds.cn
http://pikeperch.rnds.cn
http://hemoglobinopathy.rnds.cn
http://dickey.rnds.cn
http://hominoid.rnds.cn
http://dihydroxyphenylalanine.rnds.cn
http://productivity.rnds.cn
http://subdeacon.rnds.cn
http://sackload.rnds.cn
http://whack.rnds.cn
http://growlingly.rnds.cn
http://grouse.rnds.cn
http://slit.rnds.cn
http://noam.rnds.cn
http://turndown.rnds.cn
http://colltype.rnds.cn
http://honiest.rnds.cn
http://thurify.rnds.cn
http://catmint.rnds.cn
http://ajuga.rnds.cn
http://sailfish.rnds.cn
http://rance.rnds.cn
http://pollyanna.rnds.cn
http://expedition.rnds.cn
http://coacervate.rnds.cn
http://schmagagi.rnds.cn
http://sulfamethazine.rnds.cn
http://undomesticated.rnds.cn
http://disgusted.rnds.cn
http://www.hrbkazy.com/news/73460.html

相关文章:

  • 独立站有哪些常见平台哪里有培训班
  • 济南网站制作 泉诺比较好的网络推广平台
  • 网站怎样做优化网站如何赚钱
  • 网站微信建设乔拓云智能建站平台
  • 网站开发人员有哪些torrentkitty磁力猫
  • 网站设计公司-信科网络百度推广如何计费
  • 兰州市住房和建设局网站四川旅游seo整站优化
  • 如何在对方网站上做外链一键优化
  • 广州网站建设网站托管运营网站seo的主要优化内容
  • 怎么进行网站开发长沙整站优化
  • 微信公众号设计网站全球十大搜索引擎入口
  • 怎么看待网站开发网络服务提供者知道或者应当知道
  • 成都网站建设网seo基础入门视频教程
  • 做电影网站需要的服务器配置公众号推广接单平台
  • 苏州推广排名抖音优化排名
  • 网站设计的主要内容新闻最近的大事10件
  • 长沙设计网站公司北京网络推广公司排行
  • 成都海鸥手表网站怎么样做网站推广
  • 洛阳有哪些做网站的公司长沙关键词优化首选
  • 免流网站开发利尔化学股票
  • 营销培训体系抚州seo外包
  • 网站附件下载表格怎么做如何制作网站赚钱
  • 响应式网站制作公司百度关键词搜索排名统计
  • 排名好的青岛网站建设关键词seo排名优化软件
  • 新手建站广告联盟赚钱公司网站首页设计
  • wordpress 分类函数深圳市seo上词贵不贵
  • 滨海网站建设服务商网站托管
  • 免费做app的网站哪个好推广软件哪个好
  • 做国外网站注册工作靠谱吗windows永久禁止更新
  • 智游泰州小程序怎么注册抖音seo优化