https://www.codewars.com/kata/57096af70dad013aa200007b/train/javascript Your Task Given an array of Boolean values and a logical operator, return a Boolean result based on sequentially applying the operator to the values in the array. Examples booleans = [True, True, False], operator = "AND" True AND True -> True True AND False -> False return False booleans = [True, True, False], operator = "OR" True OR True -> True True OR False -> True return True booleans = [True, True, ...
IT Community and Answers Latest Questions
Description:get ascii value of characterwrite a function getASCII which inputs a character and returns the corresponding ascii value for that character. Example : getASCII(‘A’) => 65for ASCII table, you can refer to http://www.asciitable.com/ const getASCII = c ...
Description:Add two logs with base X, with the value of A and B. Example log A + log B where the base is X. function logs(x , a, b){ return (Math.log(a*b) / Math.log(x)); } Related Questions ...
Return the Nth Even Number Example(Input –> Output) 1 --> 0 (the first even number is 0) 3 --> 4 (the 3rd even number is 4 (0, 2, 4)) 100 --> 198 1298734 --> 2597466 The input will not be 0. function nthEven(n){ return (n-1)*2; } // function nthEven(n) { ...
Introduction The first century spans from the year 1 up to and including the year 100, The second – from the year 101 up to and including the year 200, etc. Task : Given a year, return the century it is in. Input , Output Examples : 1705 --> ...
Issue Looks like some hoodlum plumber and his brother has been running around and damaging your stages again. The pipes connecting your level’s stages together need to be fixed before you receive any more complaints. Each pipe should be connecting, since the levels ...