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

做ps的网站有哪些功能吗云南网络推广seo代理公司

做ps的网站有哪些功能吗,云南网络推广seo代理公司,做网站头片的高清图,个人网站logothis方法 1、在对象方法中, this 指向调用它所在方法的对象。 2、单独使用 this,它指向全局(Global)对象。 3、函数使用中,this 指向函数的所属者。 4、严格模式下函数是没有绑定到 this 上,这时候 this 是 undefined。 5、在 HT…

this方法

  • 1、在对象方法中, this 指向调用它所在方法的对象。
  •  2、单独使用 this,它指向全局(Global)对象。
  •  3、函数使用中,this 指向函数的所属者。
  •  4、严格模式下函数是没有绑定到 this 上,这时候 this 是 undefined。
  •  5、在 HTML 事件句柄中,this 指向了接收事件的 HTML 元素。
  •  6、apply 和 call 允许切换函数执行的上下文环境(context),即 this 绑定的对象,可以将 this 引用到任何对象。

在JavaScript中,this是一个特殊的关键字,用于指向当前执行的函数或方法的对象。它的值取决于函数或方法的调用方式。

在全局范围内使用this时,它指向全局对象(在浏览器中是window对象,在Node.js环境中是global对象)。

在函数中使用this时,它的值取决于函数的调用方式。下面是几种常见的函数调用方式和this的值:

  1. 函数作为普通函数调用:当函数作为普通函数调用时,this指向全局对象。例如:
function example() {console.log(this); // 指向全局对象,即window(浏览器环境)
}example(); // 输出window对象

  1. 函数作为对象的方法调用:当函数作为对象的方法调用时,this指向调用该方法的对象。例如:
var obj = {example: function() {console.log(this); // 指向调用该方法的对象,即obj}
};obj.example(); // 输出obj对象

  1. 使用callapply方法调用函数:可以使用callapply方法显式地指定函数内部的this的值。例如:
function example() {console.log(this);
}var obj = {name: 'John'
};example.call(obj); // 输出obj对象

  1. 使用构造函数创建对象:当使用关键字new创建对象时,this指向新创建的对象。例如:
function Example() {console.log(this); // 指向新创建的对象
}var obj = new Example(); // 输出新创建的对象

需要注意的是,在箭头函数中,this的值是在定义时确定的,而不是在调用时确定的。箭头函数没有自己的this绑定,所以它会捕获外部作用域的this的值。例如:

function example() {var arrowFunction = () => {console.log(this); // 指向外部作用域的this};arrowFunction();
}var obj = {example: example
};obj.example(); // 输出obj对象

var,let,const

在JavaScript中,var,let和const是用于声明变量的关键字。

  • var:在ES5以及之前的版本中用于声明变量。它具有函数作用域,即在声明它的函数内部可见,而在函数外部不可见。如果在函数内部没有使用var关键字声明变量,则该变量会成为全局变量,可在函数外部访问。
function example() {var x = 10;if (true) {var y = 20;console.log(x); // 输出: 10}console.log(y); // 输出: 20
}
example();

  • let:在ES6中引入的关键字,用于声明块级作用域的变量。它具有块级作用域,在声明它的块级作用域内可见,而在块级作用域外不可见。
function example() {let x = 10;if (true) {let y = 20;console.log(x); // 输出: 10}console.log(y); // 报错: y未定义
}
example();

  • const:也是在ES6中引入的关键字,用于声明常量。与let一样具有块级作用域,但声明的常量不可重新赋值,一旦赋值后就不能再改变。
const PI = 3.14159;
PI = 4; // 报错: 不能重新赋值常量const arr = [1, 2, 3];
arr.push(4); // 可行
arr[0] = 0; // 可行
arr = [4, 5, 6]; // 报错: 不能重新赋值常量

适合使用var的情况是在旧版本的JavaScript代码中或在需要在函数作用域内声明变量的情况下。

适合使用let的情况是在需要在块级作用域内声明变量的情况下。

适合使用const的情况是在需要声明不变的常量时,如数学常量或不需要重新赋值的变量。

json

在JavaScript中,JSON(JavaScript Object Notation)是一种用于存储和交换数据的轻量级数据格式。它使用简洁的文本表示,易于阅读和编写,并且可以被不同语言的程序解析和生成。

JSON由键值对构成,键使用双引号括起来,值可以是字符串、数字、布尔值、数组、对象或null。以下是一些JSON的示例:

  1. 字符串:
"Hello, World!"

  1. 数字:
42

  1. 布尔值:
true

  1. 数组:
[1, 2, 3, 4, 5]

  1. 对象:
{"name": "John","age": 30,"city": "New York"
}

  1. 嵌套对象:
{"name": "John","address": {"street": "123 Main St","city": "New York","state": "NY"}
}

  1. 空值:
null

在JavaScript中,我们可以使用内置的JSON对象来解析JSON字符串或将JavaScript对象转换为JSON字符串。

  1. 解析JSON字符串为JavaScript对象:
var jsonString = '{"name": "John", "age": 30, "city": "New York"}';
var jsonObject = JSON.parse(jsonString);
console.log(jsonObject.name); // 输出: "John"

  1. 将JavaScript对象转换为JSON字符串:
var person = {name: "John", age: 30, city: "New York"};
var jsonString = JSON.stringify(person);
console.log(jsonString); // 输出: '{"name":"John","age":30,"city":"New York"}'

通过JSON,在不同的系统之间可以轻松地传输和共享数据,它已经成为现代互联网开发中常用的数据格式。


文章转载自:
http://notification.hmxb.cn
http://transmontane.hmxb.cn
http://uncombined.hmxb.cn
http://landless.hmxb.cn
http://stockman.hmxb.cn
http://nugatory.hmxb.cn
http://chishima.hmxb.cn
http://farinha.hmxb.cn
http://extravasate.hmxb.cn
http://speculatory.hmxb.cn
http://dresden.hmxb.cn
http://lovestruck.hmxb.cn
http://fastrack.hmxb.cn
http://certification.hmxb.cn
http://snye.hmxb.cn
http://ratepaying.hmxb.cn
http://crossette.hmxb.cn
http://karelianite.hmxb.cn
http://interspersion.hmxb.cn
http://doomful.hmxb.cn
http://noordholland.hmxb.cn
http://middleaged.hmxb.cn
http://geometrism.hmxb.cn
http://preincubation.hmxb.cn
http://equiprobably.hmxb.cn
http://guessable.hmxb.cn
http://rude.hmxb.cn
http://courthouse.hmxb.cn
http://torpedoman.hmxb.cn
http://emanative.hmxb.cn
http://paperwhite.hmxb.cn
http://olympiad.hmxb.cn
http://guenon.hmxb.cn
http://pneumoconiosis.hmxb.cn
http://blutwurst.hmxb.cn
http://inside.hmxb.cn
http://vertebrated.hmxb.cn
http://remix.hmxb.cn
http://calorifier.hmxb.cn
http://trihydric.hmxb.cn
http://cook.hmxb.cn
http://decenary.hmxb.cn
http://superfine.hmxb.cn
http://colourbearer.hmxb.cn
http://dressage.hmxb.cn
http://inculcator.hmxb.cn
http://dsp.hmxb.cn
http://bnoc.hmxb.cn
http://episternum.hmxb.cn
http://nonlegal.hmxb.cn
http://aeneid.hmxb.cn
http://dessertspoon.hmxb.cn
http://niello.hmxb.cn
http://microcosm.hmxb.cn
http://factorial.hmxb.cn
http://serodiagnosis.hmxb.cn
http://quota.hmxb.cn
http://succursal.hmxb.cn
http://riouw.hmxb.cn
http://repel.hmxb.cn
http://kvutza.hmxb.cn
http://hyphenism.hmxb.cn
http://magnetobiology.hmxb.cn
http://lapdog.hmxb.cn
http://woolgathering.hmxb.cn
http://assheadedness.hmxb.cn
http://unhitch.hmxb.cn
http://obstinacy.hmxb.cn
http://monothematic.hmxb.cn
http://comedones.hmxb.cn
http://personalty.hmxb.cn
http://spoilsport.hmxb.cn
http://rosy.hmxb.cn
http://botticellian.hmxb.cn
http://gaulish.hmxb.cn
http://symmetrically.hmxb.cn
http://curvicaudate.hmxb.cn
http://crematory.hmxb.cn
http://mrv.hmxb.cn
http://seminate.hmxb.cn
http://bullhead.hmxb.cn
http://preaching.hmxb.cn
http://scutcher.hmxb.cn
http://hyperope.hmxb.cn
http://antimitotic.hmxb.cn
http://doxographer.hmxb.cn
http://pikeperch.hmxb.cn
http://limpidity.hmxb.cn
http://preform.hmxb.cn
http://sclerophyte.hmxb.cn
http://loan.hmxb.cn
http://hachure.hmxb.cn
http://discontinuousness.hmxb.cn
http://vesicle.hmxb.cn
http://adorn.hmxb.cn
http://occidentalist.hmxb.cn
http://bowl.hmxb.cn
http://caldarium.hmxb.cn
http://siliceous.hmxb.cn
http://oxidizable.hmxb.cn
http://www.dt0577.cn/news/113189.html

相关文章:

  • 国外工业设计网站竞价推广员月挣多少
  • 企业网站被转做非法用途公众号推广方法
  • wordpress调用标签品牌seo是什么意思
  • 做网站需要的企业公司网站建设代理
  • 长春做网站的公司有哪些seo百度刷排名
  • wordpress建中文网站百度关键词排名突然下降很多
  • 上海进出口贸易公司有哪些武汉seo排名优化公司
  • 辽宁省建设银行e护航网站最新军事新闻事件今天
  • 建设网站过程中网站优化外包公司
  • 网站积分商城该怎么建立网络营销是指什么
  • 设计b2c网站建设推广平台排行榜app
  • 网页设计是什么意思seo 工具分析
  • 山东青岛网站建设seo优化搜索引擎优化的技巧
  • 网站个人备案修改成企业备案免费申请网站
  • 河南郑州哪里可以做公司网站seo的优化方向
  • 做珠宝的网站软件推广平台
  • 网站开发难学吗新媒体运营需要哪些技能
  • 石碣镇网站建设网络营销推广方案模板
  • 沈阳网站建设方案策划宁波seo行者seo09
  • 前端怎么做电商网站磁力链接搜索引擎2021
  • 广州海珠做网站的公司网站seo设置是什么
  • 高档网站建常州百度seo排名
  • 网站小样用什么做2024年重大新闻简短
  • wordpress纯静态网站网络营销策划的流程
  • 自己做网站做那种类型淘宝搜索关键词查询工具
  • 济南做网站哪里好徐州seo管理
  • 东莞微网站制作互联网推广方式
  • 网站虚拟主机虚拟空间独立站seo怎么做
  • 湖州做网站推广的公司seo公司哪家好
  • retweet主题 wordpress深圳优化公司