Skip to content

Commit 9d6f83c

Browse files
committed
docs: revised according to review.
1 parent 0ce0dde commit 9d6f83c

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

examples/09_Kotlin_JS/01_dynamic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fun main(){
3030

3131
</div>
3232

33-
1. Any value can be assigned to variable of the `dynamic` type.
33+
1. Any value can be assigned to a `dynamic` variable type.
3434
2. A dynamic value can be assigned to anything.
3535
3. A dynamic variable can be passed as an argument to any function.
3636
4. Any property or function with any arguments can be called on a `dynamic` variable.

examples/09_Kotlin_JS/02_js_function.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# JS function
22

3-
You can inline some JavaScript code into your Kotlin code using the `js("…")` function.
4-
Should be used with extreme care.
3+
You can inline JavaScript code into your Kotlin code using the js("…") function.
4+
This should be used with extreme care.
5+
56

67
<div class="language-kotlin" theme="idea" data-min-compiler-version="1.3" data-target-platform="js">
78

@@ -32,6 +33,6 @@ fun main(){
3233

3334
</div>
3435

35-
1. Creating a JavaScript object literal. The `js(...)` function return type is `dynamic`.
36-
2. Adding some properties by utilizing the `dynamic` type capabilities.
37-
3. Passing the JSON to JavaScript API.
36+
1. Creates a JavaScript object literal. The `js(...)` function return type is `dynamic`.
37+
2. Adds some properties by utilizing the `dynamic` type capabilities.
38+
3. Passes the JSON to JavaScript API.

examples/09_Kotlin_JS/03_external.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ fun main() {
1414

1515
</div>
1616

17-
1. Declaring an existing JavaScript function `alert` which takes a single `String` argument.
18-
2. Using `alert` as if it was regular Kotlin.
17+
1. Declares an existing JavaScript function `alert` which takes a single `String` argument.
18+
2. Uses `alert` as if it were regular Kotlin.
1919

20-
Note that Kotlin checks during compilation that exactly a single argument of type `String` is passed.
21-
That prevents a number of bugs even when using pure JavaScript API - same as with regular Kotlin.
20+
Note that Kotlin checks during compilation, that a single argument of type String is passed.
21+
Such a check prevents some bugs even when using pure JavaScript API.
2222

2323
Please [refer to the docs](https://kotlinlang.org/docs/reference/js-interop.html#external-modifier) in order
2424
to learn more about describing existing JavaScript API.

examples/09_Kotlin_JS/06_HtmlBuilder.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Html Builder
22

3-
Kotlin provides you with a option to describe structured data in a declarative style with _builders_.
3+
Kotlin provides you with an option to describe structured data in a declarative style with _builders_.
44

5-
Below is an example of a type-safe Groovy-style builder. In this example we show how to describe an HTML page in Kotlin.
5+
Below is an example of a type-safe Groovy-style builder. In this example, we will describe an HTML page in Kotlin.
66

77
<div class="language-kotlin" theme="idea" data-min-compiler-version="1.3" data-target-platform="canvas" data-output-height="400">
88

@@ -127,6 +127,6 @@ fun html(init: HTML.() -> Unit): HTML {
127127

128128
2. `head` and `body` are member functions of the`HTML` class.
129129

130-
3. The text is added to tags by calling the `unaryPlus()` operation, like `+"HTML encoding with Kotlin"`.
130+
3. Adds the text to tags by calling the `unaryPlus()` operation, like `+"HTML encoding with Kotlin"`.
131131

132132
For details see: [Type Safe Builders](http://kotlinlang.org/docs/reference/type-safe-builders.html)

0 commit comments

Comments
 (0)