while 循环结束后 animals 的值是多少?
What does this code print to the console?
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: medium
分类: JavaScript Loops
标签: while, logical OR
参考答案摘要
循环条件是 rainForestAcres < 13 || animals <= 2 。从 10 开始,每次 animals += 2 :2、4、6;当 acres 到 13 且 animals=6 时,两个条件都为 false,循环结束,因此输出 6。
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。