<div dir="ltr"><h2><span class="" id="Assignment_2_Write_a_function_that_removes_duplicate_numbers_from_an_array.">Assignment 2 Write a function that removes duplicate numbers from an array. </span></h2><a href="https://noisebridge.net/wiki/JavaScript/Notes/Array#Assignment_3_Write_a_function_that_sorts_an_array_of_strings_case-insensitively">https://noisebridge.net/wiki/JavaScript/Notes/Array#Assignment_3_Write_a_function_that_sorts_an_array_of_strings_case-insensitively</a>.<br>
<br><br><a href="http://jsbin.com/ELiqOtEpu/1/edit?html,js,output">http://jsbin.com/ELiqOtEpu/1/edit?html,js,output</a><br><br>var input = [1, 2, 3, 1, 0, 1];<br>var result = arrayUniqueNumbers( input ); // [1, 2, 3, 0];<br>
<br>function arrayUniqueNumbers(input) {<br>  var occur = {};<br>  var result = [];<br>  var i;<br>  for( i = 0; i < input.length; i++ ) {<br>    if( !(input[i] in occur) ) {<br>      result.push(input[i]);<br>      occur[input[i]] = true;<br>
    }<br>  }<br>  return result;<br>}<br clear="all"><br>-- <br><div dir="ltr">Garrett<br>@xkit<br><div><a href="http://ChordCycles.com" target="_blank">ChordCycles.com</a><br></div></div>
</div>