gpt4 book ai didi

javascript - JavaScript 如何计算 : (colon)

转载 作者:搜寻专家 更新时间:2023-11-01 04:51:57 26 4
gpt4 key购买 nike

一个小问题:

如果我在我的浏览器 (GoogleChrome) 控制台中输入

abc:xyz:123

它的计算结果为

123

JavaScript 如何计算:

最佳答案

abcxyz 都被视为循环标签。引自 MDN ,

Provides a statement with an identifier that you can refer to using a break or continue statement.

For example, you can use a label to identify a loop, and then use the break or continue statements to indicate whether a program should interrupt the loop or continue its execution.

另外,检查 Avoid using labels节,

Labels are not very commonly used in JavaScript since they make programs harder to read and understand. As much as possible, avoid using labels and, depending on the cases, prefer calling functions or throwing an error.

关于javascript - JavaScript 如何计算 : (colon),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24081201/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com