Cengage Angular First Duplicate
HTML
<!-- Add AngularJS code to display the list -->
<!-- Add code to mark the first duplicate in the list --->
<div ng-app="DuplicateApp">
<ul id="theList">
<li ng-repeat="num in numbers">
{{num}}
</li>
</ul>
</div>
JavaScript
/*
Write an algorithm that will find the first duplicate in a list on the page.
For example we would return 4, for the list above.
*/
var app = angular.module("DuplicateApp", []);
app.controller("DuplicateController", function($scope){
var numbers = [
6,
3,
1,
4,
7,
4,
2,
8,
9,
2
];
$scope.numbers = numbers;
});