摘要:
// charAt():返回指定位置的字符。 const str = "hello"; const char = str.charAt(1); // "e" // charCodeAt():返回指定位置字符的Unicode编码。 const str = "hello"; const unicode 阅读全文
posted @ 2023-04-23 13:05
菜汤不甜
阅读(79)
评论(0)
推荐(0)
摘要:
//"?." 是JavaScript中的可选链操作符,用于在对象属性链式调用过程中判断前面的属性是否存在,// 如果存在则继续调用,否则返回undefined。这个操作符可以避免因为某个属性不存在而出现程序崩溃或异常情况,提高代码的健壮性和可读性。例如: const person = { name: 阅读全文
posted @ 2023-04-23 12:55
菜汤不甜
阅读(30)
评论(0)
推荐(0)

浙公网安备 33010602011771号