File tree Expand file tree Collapse file tree 4 files changed +14
-13
lines changed Expand file tree Collapse file tree 4 files changed +14
-13
lines changed Original file line number Diff line number Diff 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.
34342 . A dynamic value can be assigned to anything.
35353 . A dynamic variable can be passed as an argument to any function.
36364 . Any property or function with any arguments can be called on a ` dynamic ` variable.
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff 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
2323Please [ refer to the docs] ( https://kotlinlang.org/docs/reference/js-interop.html#external-modifier ) in order
2424to learn more about describing existing JavaScript API.
Original file line number Diff line number Diff line change 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
1281282 . ` 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
132132For details see: [ Type Safe Builders] ( http://kotlinlang.org/docs/reference/type-safe-builders.html )
You can’t perform that action at this time.
0 commit comments