“that”<“this”
时间: 2023-11-05 22:26:49 浏览: 17
"that" is used to refer to something that is farther away, either in distance or time, while "this" is used to refer to something that is closer in distance or time. For example, if I am pointing to a car that is far away and saying "that car is red", I would use "that". If I am pointing to a car that is close by and saying "this car is red", I would use "this".
相关问题
Python里“that”<“this”
在 Python 中,字符串是按照字典序进行比较的。因此,如果两个字符串都只包含字母,那么它们的比较结果将与它们在字母表中的顺序相同。在这种情况下,"that" < "this" 是正确的,因为在字母表中,"h" 排在 "i" 的前面。但是,如果字符串中包含数字或其他字符,它们的比较结果可能会出现意外的结果。
const that = this 作用
在 JavaScript 中,const 关键字用于声明一个只读的常量。而在这个语句中,const that = this 的作用是将当前上下文的 this 对象赋值给一个常量 that,以便在后续的代码中能够使用该常量来访问 this 对象。这是因为在 JavaScript 中,this 的值是动态的,在不同的上下文中可能会指向不同的对象,而使用常量来保存 this 的值能够避免在后续的代码中出现 this 指向不正确的情况。通常在需要在回调函数或者异步操作中访问 this 对象时,使用 const that = this 这种方式是非常常见的。