@@ -0,0 +1,14 @@
+function main() {
+ console.log(triangle(1))
+ console.log(triangle(6))
+ console.log(triangle(215))
+}
+
+function triangle(num) {
+ var result = 1
+ for (var i = 2; i <= num; ++i)
+ result += i
+ return result
+main()
@@ -0,0 +1,16 @@
+# Triangular Number Sequence
+This Triangular Number Sequence is generated from a pattern of dots that form a triangle. The first 5 numbers of the sequence, or dots, are:
+```
+1, 3, 6, 10, 15
+This means that the first triangle has just one dot, the second one has three dots, the third one has 6 dots and so on.
+Write a function that returns the number of dots when given its corresponding triangle number of the sequence.
+### Examples
+```js
+triangle(1) ➞ 1
+triangle(6) ➞ 21
+triangle(215) ➞ 23220