I’m new in Dart language but I still working on ! I got this problem, I want to calculate the table of multiplication of : 14.
So basicly, i want to get this results:
14,28,42,56,70,84,98,112,126, etc etc to 1400
My function work, when I print my result. But I can’t paste the results in a div.
There is my .dart :
main() {
var numero2 = 14;
var multiplication = 0;
var element02 = query('#exercice02');
for (var i = 1; i < 101; i++) {
multiplication = numero2 * i;
print(multiplication);
}
//element02.text = multiplication;
}
And in my html i got :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HelloWorld</title>
<link rel="stylesheet" href="HelloWorld.css">
</head>
<body>
<div id="container">
<p class="question">Exercice 02 : 100 x 14 : <span id="exercice02"></span></p>
</div>
<script type="application/dart" src="web/HelloWorld.dart"></script>
<script src="https://dart.googlecode.com/svn/branches/bleeding_edge/dart/client/dart.js"></script>
</body>
</html>
Actually, I dont know how to concatane the results, I try as you can see the : element02.text = multiplication; in FOR, but it destroy it, and then I try the += and they are multiplicating together and I only have 1 result at the end.
Some one can help me ?
How do you want the results to be displayed? Like:
14, 28, 42?test.dart
test.html
Output: