Ruby - CSS - HTML - Javascript - Rails 5 - Sinatra - Jasmine - RSpec - PostgreSQL - SQLite3 - JQuery - AJAX - Bootstrap - Sketch - Heroku - API Consumption - Git - Github - Agile Workflow - Active Record
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Returns either the index of the location in the array, | |
or -1 if the array did not contain the targetValue */ | |
var doSearch = function(array, targetValue) { | |
var min = 0; | |
var max = array.length - 1; | |
var guess; | |
var i = 1; | |
while (max >= min){ | |
guess = Math.floor((max + min)/2); |