2017-10-31每日一练
来源:互联网 发布:java从入门到精通 编辑:程序博客网 时间:2024/06/04 20:05
2017-10-31每日一练
答:两个函数返回的值并不一样,如果执行以下语句:
console.log(foo1());
console.log(foo2());
将分别得到下面的结果:
Object {bar: “hello”}
undefined
产生这个结果的原因是分号在JavaScript中的用法(省略分号不是好的做法)。当foo2()的一行语句中只包含return时,会在return语句后面自动的加上一个分号。后面的语句也是合法的,不会抛出error,尽管它不会调用,也不做任何事(仅仅只是一个没有用到的语句块)。
这说明了在Javascript中大括号的位置应该放在语句后面的编程风格更符合Javascript的语法要求(有些语言推荐放在新一行的开头)。
SELECT name FROM student_score WHERE name NOT IN (SELECT name FROM student_score WHERE score <= 80 ) GROUP BY name;
class Test { public static void main(String[] args) { double height = 100.0; double sum = 0.0; for (int i = 1; i <= 10; i++) { sum = sum + height; height = height/2; sum = sum + height; } sum = sum - height; System.out.println("第10次落地时共经过" + sum +"米。"); System.out.println("第10次落地时反弹" + height +"米。"); }}
阅读全文
0 0
- 2017-10-31每日一练
- 每日一练10
- 每日一练-10
- 2017-10-30每日一练
- 每日一练2017-10-30
- iphone开发每日一练【2011-10-31】
- 2017-11-1每日一练
- 2017-11-2每日一练
- 每日一练(2017-11-03)
- 2017-11-3每日一练
- 2017-11-7每日一练
- 2017-11-7每日一练
- 2017-11-9每日一练
- 2017-11-12每日一练
- 2017-11-14每日一练
- 2017-11-22每日一练
- 每日一练10月26日
- 算法每日一练
- 【git 使用详解(4)】-- 初体验
- 【JZOJ5433】图
- eclipse git报错git The current branch is not configured for pull No value for key branch.master.merge
- HDOJ 1215 七夕节
- Linux中的自动安装脚本
- 2017-10-31每日一练
- 刷题——5.5
- LeetCode 121: Best Time to Buy and Sell Stock
- 批处理作业问题——分支限界法
- 重命名UE4项目
- 译文及题解 电话线Telephone Wire(动态规划)
- 关于未来,仅供参考
- 第一次实验
- vue组件通信