JS-Week-2:第 2 周结束作业
![preview](https://csdnimg.cn/release/downloadcmsfe/public/img/white-bg.ca8570fa.png)
![preview-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/scale.ab9e0183.png)
在JavaScript的世界里,第二周的学习通常会涉及到许多关键概念,为初学者建立坚实的基础。本周的作业可能旨在深化对变量、数据类型、操作符、控制流以及函数的理解。以下是这些核心概念的详细解释: 1. **变量(Variables)**:在JavaScript中,变量用于存储数据。你可以将它们想象为一个可以改变的容器。使用`let`、`const`或`var`关键字来声明变量。`let`和`const`是ES6引入的新特性,其中`let`允许重新赋值,而`const`则一旦赋值就不能更改。 2. **数据类型(Data Types)**:JavaScript有七种数据类型,分为两大类:基本类型(Primitive Types)和引用类型(Reference Types)。基本类型包括`null`、`undefined`、`boolean`、`number`、`string`、`BigInt`和`Symbol`。引用类型主要是`Object`,其中包括数组和函数。 3. **操作符(Operators)**:操作符用于改变变量的值或进行比较。常见的操作符有算术操作符(如+、-、*、/、%),比较操作符(如==、===、<、>、<=、>=),逻辑操作符(如&&、||、!),赋值操作符(如=、+=、-=等),以及三元运算符(如条件表达式? :)。 4. **控制流(Control Flow)**:控制流语句决定了程序执行的顺序。`if...else`语句用于条件判断,`switch...case`提供多条件选择。`for`、`while`循环用于重复执行某段代码,`do...while`循环则是先执行后判断。`break`和`continue`用来提前结束循环或跳过当前迭代。 5. **函数(Functions)**:函数是可重用的代码块,可以接收参数并返回值。函数声明使用`function`关键字,函数表达式如匿名函数和箭头函数也是常见的形式。函数还可以作为一等公民,意味着它们可以被赋值给变量、作为参数传递和作为其他函数的返回值。 在"JS-Week-2-gh-pages"这个文件中,很可能包含了作业的源代码,比如HTML和JavaScript文件,它们可能包含了一些练习题和项目,用于实践上述概念。GitHub Pages的命名表明这可能是一个公开的网页项目,学生可以通过这种方式分享和展示他们的作业成果。 学习JavaScript的第二周,重点在于巩固基础,确保对这些基本概念有深入理解,因为它们是构建更复杂功能和项目的基础。通过完成这些作业,学生们将能够编写出更有效的代码,并为后续的JavaScript学习打下坚实的基础。
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![js](https://img-home.csdnimg.cn/images/20210720083646.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/HTML.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
- 1
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/04fd3c7d20f6413da32674a210bab09d_weixin_42134054.jpg!1)
- 粉丝: 20
- 资源: 4728
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)