1-js/02-first-steps/16-javascript-specials#46
Merged
leviding merged 10 commits intojavascript-tutorial:zh-hansfrom May 14, 2018
liang-kai:translate
Merged
1-js/02-first-steps/16-javascript-specials#46leviding merged 10 commits intojavascript-tutorial:zh-hansfrom liang-kai:translate
leviding merged 10 commits intojavascript-tutorial:zh-hansfrom
liang-kai:translate
Conversation
added 2 commits
April 18, 2018 16:05
Member
|
resolve #16 |
Member
|
@liang-kai 下次记得 resolve 一下对应的 issue |
Contributor
|
校对认领 |
Member
Contributor
|
@leviding 校对认领 |
Starriers
reviewed
Apr 23, 2018
Contributor
Starriers
left a comment
There was a problem hiding this comment.
@liang-kai @leviding 问题多多! 先去重看译者教程 然后去学习 md 看看怎么用 看看为什么要空格和换行。如果有需要你改了可以我可以再给你看看!
| Statements are delimited with a semicolon: | ||
| ## 代码结构 | ||
|
|
||
| 语句用分号分隔: |
| - `undefined` -- a type with a single value `undefined`, meaning "not assigned", | ||
| - `object` and `symbol` -- for complex data structures and unique identifiers, we haven't learnt them yet. | ||
| 有7种数据类型: | ||
| - `number` -- 可以是浮点数,也可以是整数, |
| - `number` -- 可以是浮点数,也可以是整数, | ||
| - `string` -- 字符串类型, | ||
| - `boolean` -- 逻辑值: `true/false`, | ||
| - `null` -- 具有单个值'null'的类型,表示“空”或“不存在”, |
| ``` | ||
|
|
||
| More in: <info:variables> and <info:types>. | ||
| 更多信息:<info:variables>和<info:types>。 |
| :输出一个`消息`。 | ||
|
|
||
| All these functions are *modal*, they pause the code execution and prevent the visitor from interacting with the page until he answers. | ||
| 所有这些函数都会产生模态框,它们会暂停代码执行并阻止访问者与页面交互,直到他响应弹框。 |
|
|
||
| Logical operators | ||
| : There are few others, like a comma operator. | ||
| 其他运算符 |
| 更多信息:<info:operators>, <info:comparison>, <info:logical-operators>。 | ||
|
|
||
| ## Loops | ||
| ##循环语句 |
| - The variable declared in `for(let...)` loop is visible only inside the loop. But we can also omit `let` and reuse an existing variable. | ||
| - Directives `break/continue` allow to exit the whole loop/current iteration. Use labels to break nested loops. | ||
| - 在`for(let...)`循环中声明的变量只在循环中可见。但是我们也可以省略`let`并重用现有的变量。 | ||
| - 指令`break / continue`允许退出整个循环/当前迭代。使用标签来打破嵌套循环。 |
| ``` | ||
|
|
||
| 2. Function Expression: the function in the context of an expression | ||
| 2. 函数表达式:表达式的方式声明函数 |
| ##更多 | ||
|
|
||
| That was a brief list of JavaScript features. As of now we've studied only basics. Further in the tutorial you'll find more specials and advanced features of JavaScript. | ||
| 这是JavaScript功能的简要概述。截至目前,我们只研究基础知识。在本教程中,您会发现更多特殊功能和JavaScript高级功能。 No newline at end of file |
|
@liang-kai 认真看译者教程,自己修改一遍,再艾特校对者进行校对。请认真学习译者教程。 |
Contributor
|
@liang-kai @leviding 快来修改呀,我好校对,一直这么挂着,我一天要来看一遍。。 |
Contributor
Author
|
好,今天晚些时候了
… On 26 Apr 2018, at 5:05 PM, allen ***@***.***> wrote:
@liang-kai <https://github.com/liang-kai> @leviding <https://github.com/leviding> 快来修改呀,我好校对,一直这么挂着,我一天要来看一遍。。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#46 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AP37fsw1XrMRics026WtvY1PQ0zjQD2Zks5tsY2_gaJpZM4TZnlV>.
|
added 2 commits
April 26, 2018 20:31
Contributor
Author
|
@allenlongbaobao @Starriers @fanyijihua 修改了,劳烦再看下 |
Member
|
@allenlongbaobao @Starriers 可以继续了哈 |
|
|
||
| Semicolons are not required after code blocks `{...}` and syntax constructs with them like loops: | ||
| 大多数代码风格指南都认为我们应该在每个语句后面加上分号。 | ||
| 在代码块`{}`之后以及循环语句后不需要使用分号: |
| ``` | ||
|
|
||
| That's called "automatic semicolon insertion". Sometimes it doesn't work, for instance: | ||
| 这就是所谓的“自动分号插入”。有时它不起作用,例如: |
|
|
||
| More in: <info:structure>. | ||
| ``` | ||
| ...但即使我们可以在某处添加了“额外”分号,这也不是错误。它会被忽略的。 |
Contributor
There was a problem hiding this comment.
对的,可以参考译者教程 => 全角和半角
| ## 严格模式 | ||
|
|
||
| To fully enable all features of modern JavaScript, we should start scripts with `"use strict"`. | ||
| 为了完全启用现代JavaScript的所有功能,我们应该使用`“use strict”`指令。 |
Contributor
There was a problem hiding this comment.
[“use strict”] => ["use strict"]
Member
|
@liang-kai 译文排版需要按照译者教程来,麻烦再按照要求修改一遍吧。 |
Member
|
@Starriers @allenlongbaobao 没校对完可以继续了 |
Member
|
@liang-kai 辛苦了 |
Starriers
reviewed
May 4, 2018
Contributor
Starriers
left a comment
There was a problem hiding this comment.
@liang-kai @leviding 校对完成
| 该指令必须位于 JavaScript 文件的顶部或函数的开头。 | ||
|
|
||
| Without `"use strict"`, everything still works, but some features behave in the old-fashion, "compatible" way. We'd generally prefer the modern behavior. | ||
| 如果没有使用严格模式,所有东西都可以正常工作,但是某些功能的表现方式与旧式「兼容」方式相同。我们通常喜欢更现代的方式。 |
| 一个合格的变量名可以由以下组成: | ||
|
|
||
| - 字符串和数字,但是第一个字符不能是数字。 | ||
| - 字符`$`和`_`是允许的,用法同字母。 |
| - `object` and `symbol` -- for complex data structures and unique identifiers, we haven't learnt them yet. | ||
| - `number` —— 可以是浮点数,也可以是整数, | ||
| - `string` —— 字符串类型, | ||
| - `boolean` —— 逻辑值: `true/false`, |
| - `number` —— 可以是浮点数,也可以是整数, | ||
| - `string` —— 字符串类型, | ||
| - `boolean` —— 逻辑值: `true/false`, | ||
| - `null` —— 具有单个值`null`的类型,表示「空」或「不存在」, |
| - `string` —— 字符串类型, | ||
| - `boolean` —— 逻辑值: `true/false`, | ||
| - `null` —— 具有单个值`null`的类型,表示「空」或「不存在」, | ||
| - `undefined` —— 一个具有单个值`undefined`的类型,表示「未分配」, |
|
|
||
| [`alert(message)`](mdn:api/Window/alert) | ||
| : Output a `message`. | ||
| :输出一个`消息`。 |
| ## 运算符 | ||
|
|
||
| JavaScript supports the following operators: | ||
| JavaScript支持以下运算符: |
| | - |可以有一个名字,只在函数内部可见| | ||
|
|
||
| More: see <info:function-basics>, <info:function-expressions-arrows>. | ||
| 更多:参见<info:function-basics>, <info:function-expressions-arrows>。 |
| Ternary | ||
| : The only operator with three parameters: `cond ? resultA : resultB`. If `cond` is truthy, returns `resultA`, otherwise `resultB`. | ||
| 按位操作 | ||
| :位运算符在位级上使用整数:当需要时,请参阅[docs](mdn:/JavaScript/Reference/Operators/Bitwise_Operators)。 |
|
|
||
| The binary plus `+` concatenates strings. And if any of the operands is a string, the other one is converted to string too: | ||
| 算数运算符 | ||
| :常规的比如:`+ - * /`(加减乘除),以及取余操作 `%` 和幂运算符 `**` 。 |
leviding
approved these changes
May 14, 2018
Member
|
@liang-kai 符号的使用上还有些问题,就是开头的那个冒号是本 Repo 的固定渲染格式,不用改动,我已经给改回来了。辛苦啦,可以看下记录哈 e41eee7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.