<<<<<<< HEAD Code Wars - Brett Crafton

Count the Monkeys

Question

You take your son to the forest to see the monkeys. You know that there are a certain number there (n), but your son is too young to just appreciate the full number, he has to start counting them from 1. As a good parent, you will sit and count with him. Given the number (n), populate an array with all numbers up to and including that number, but excluding zero.

monkeyCount(10) // --> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] monkeyCount(1) // --> [1]

Solution by -

My Solution


	function monkeyCount(n) {
		let arr = []
		for(i = 1; i <= n; i++){
			arr.push(i)
		}
		return  arr
		}
				

Try it yourself - CodeWars

======= Code Wars - Brett Crafton

Count the Monkeys

Question

You take your son to the forest to see the monkeys. You know that there are a certain number there (n), but your son is too young to just appreciate the full number, he has to start counting them from 1. As a good parent, you will sit and count with him. Given the number (n), populate an array with all numbers up to and including that number, but excluding zero.

monkeyCount(10) // --> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] monkeyCount(1) // --> [1]

Solution by -

My Solution


	function monkeyCount(n) {
		let arr = []
		for(i = 1; i <= n; i++){
			arr.push(i)
		}
		return  arr
		}
				

Try it yourself - CodeWars

>>>>>>> 0e614172debaa009c8d31330edbeb3b765b59c39