Adrian Rosales
9 min readMar 24, 2019

--

var capitals = function (word) {   let answer = [];   for(let i = 0; i <= word.length; i++){      if(/[A-Z]/.test(word[i])){         answer.push(i);      }   }   return answer;};
Gotta keep it gangsta.
var capitals = function (word) {   return word.split(‘’).reduce(function(memo, v, i) {      return v === v.toUpperCase() ? memo.concat(i) : memo;   }, []);};
var word = ‘punk’;console.log( word.split(‘’) ); // results in [‘p’,’u’,’n’,’k’]
function evaporator(content, evap_per_day, threshold){return -1;}
Test.assertEquals(evaporator(10,10,10),22);
function evaporator(content, evap_per_day, threshold) {threshold = threshold / 100evap_per_day = evap_per_day / 100return Math.ceil(Math.log(threshold) / Math.log(1-evap_per_day))}
function evaporator(content, evap_per_day, threshold) {threshold = threshold / 100evap_per_day = evap_per_day / 100return Math.ceil(Math.log(threshold) / Math.log(1-evap_per_day))}
That’s not 10!

--

--

Adrian Rosales

is a web developer, opera singer, actor, and lover of cats. (adrian-rosales.tech)