Cengage MindTap Tech Screen 2

by Matthew Vasallo

HTML

<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/jasmine/1.3.1/jasmine.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/jasmine/1.3.1/jasmine.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/1.3.1/jasmine-html.js"></script>
<title>Jasmine Spec Runner</title>

JavaScript

/*
Using TDD, write a function that accepts an array with 1 or more integer elements
(positive or negative) and returns the element that is closest to zero; e.g.: 2 is
closer than 5; -2 is closer than 4.

In the event of a tie, e.g.: [2, -2], the function should prefer the positive version
and return that.

[-8,3,11,2,-1,4,21,-3,-2]
*/

var findClosestToZero = function () {
};



describe('the findClosestToZero function', function () {
    it('should pass a sample test', function () {
        expect(1).toBe(1);
    });
});



// load jasmine htmlReporter - don't change
$(function () {
    var env = jasmine.getEnv();
    env.addReporter(new jasmine.HtmlReporter());
    env.execute();
});