This exercise is taken from https://github.com/GitbookIO/plugin-exercises
{% exercise %}
Define a variable x
equal to 10.
{% initial %}
var x =
{% solution %}
var x = 10;
{% validation %}
assert(x == 10);
{% endexercise %}
Write a look to calculate the sum of 1, 2, 3, ...., 10.
{% exercise %} Calculate the sum of 1, 2, 3, ...., 10 {% initial %} var a = 1 var b = 10 var sum = 0 {% solution %} var a = 1 var b = 10 var sum = 0 for(var x=a;x<=b;x++) { sum+=x; } {% validation %} assert(sum == 55) {% endexercise %}