This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree 2 files changed +7
-5
lines changed
src/site/_includes/language-tour/3-built-in-types
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -120,8 +120,8 @@ <h4> List and Collection methods </h4>
120
120
returns a new collection with only the elements that satisfy a condition.
121
121
The < a href ="http://api.dartlang.org/dart_core/Collection.html#every "> every()</ a > and
122
122
< a href ="http://api.dartlang.org/dart_core/Collection.html#some "> some()</ a > methods
123
- check whether a collection matches
124
- every condition or at least one condition, respectively.
123
+ check whether every item in a collection matches a condition
124
+ or if at least one item matches a condition, respectively.
125
125
The < a href ="http://api.dartlang.org/dart_core/List.html#sort "> sort()</ a > method
126
126
lets you sort a list using any criteria you like.
127
127
</ p >
Original file line number Diff line number Diff line change 57
57
</ p >
58
58
59
59
{% highlight dart %}
60
+ #import('dart:math'); // Needed for math functions. See libraries section
61
+
60
62
// String -> int
61
- var one = Math. parseInt("1");
63
+ var one = parseInt("1");
62
64
assert(one == 1);
63
65
64
66
// String -> double
65
- var onePointOne = Math. parseDouble("1.1");
67
+ var onePointOne = parseDouble("1.1");
66
68
assert(onePointOne == 1.1);
67
69
68
70
// int -> String
80
82
</ p >
81
83
82
84
{% highlight dart %}
83
- assert((3 < 1 ) == 6); // 0011 < < 1 == 0110
85
+ assert((3 < < 1 ) == 6); // 0011 < < 1 == 0110
84
86
assert((3 > > 1) == 1); // 0011 > > 1 == 0001
85
87
assert((3 | 4) == 7); // 0011 | 0100 == 0111
86
88
{% endhighlight %}
You can’t perform that action at this time.
0 commit comments