[React MAIN CONCEPTS] 8. Lists and Keys
Lists and Keys
In React, transforming arrays into lists of elements is using the map()
function.
In React, transforming arrays into lists of elements is using the map()
function.
Dart is a client-optimized language for fast apps on any platform.
This collection is not exhaustive—it’s just a brief introduction to the language for people who like to learn by example.
Swift is a powerful and intuitive programming language for macOS, iOS, watchOS, tvOS and beyond. Writing Swift code is interactive and fun, the syntax is concise yet expressive, and Swift includes modern features developers love. Swift code is safe by design, yet also produces software that runs lightning-fast.
Tradition suggests that the first program in a new language should print the words “Hello, world!” on the screen. In Swift, this can be done in a single line:
This page shows you how to use each major Dart feature, from variables and operators to classes and libraries, with the assumption that you already know how to program in another language. For a briefer, less complete introduction to the language, see the language samples page - https://dart.dev/samples.
Dart libraries are full of functions that return Future
- https://api.dart.dev/stable/dart-async/Future-class.html or Stream
- https://api.dart.dev/stable/dart-async/Stream-class.html objects. These functions are asynchronous: they return after setting up a possibly time-consuming operation (such as I/O), without waiting for that operation to complete.
Dart is an object-oriented language with classes and mixin-based inheritance. Every object is an instance of a class, and all classes descend from Object
. Mixin-based inheritance means that although every class (except for Object) has exactly one superclass, a class body can be reused in multiple class hierarchies. Extension methods are a way to add functionality to a class without changing the class or creating a subclass.
You can control the flow of your Dart code using any of the following:
if
and else
for
loops
while
and do-while
loops
break
and continue
switch
and case
assert
You can also affect the control flow using try-catch
and throw
, as explained in Exceptions - https://dart.dev/guides/language/language-tour#exceptions.
Dart is a true object-oriented language, so even functions are objects and have a type, Function. This means that functions can be assigned to variables or passed as arguments to other functions. You can also call an instance of a Dart class as if it were a function. For details, see Callable classes.
Here’s an example of implementing a function:
If you look at the API documentation for the basic array type, List, you’ll see that the type is actually List<E>
. The <…>
notation marks List as a generic (or parameterized) type—a type that has formal type parameters. By convention, most type variables have single-letter names, such as E
, T
, S
, K
, and V
.