Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Are arrow functions odd?.js
function odds(values){ return values.filter(values => values % 2 != 0); } https://www.codewars.com/kata/559f80b87fa8512e3e0000f5/train/javascript
function odds(values){
return values.filter(values => values % 2 != 0);
}
https://www.codewars.com/kata/559f80b87fa8512e3e0000f5/train/javascript
See lessCSV representation of array.js
function toCsvText(array) { return array.join('\n'); } https://www.codewars.com/kata/5a34af40e1ce0eb1f5000036/train/javascript
function toCsvText(array) {
return array.join('\n');
}
https://www.codewars.com/kata/5a34af40e1ce0eb1f5000036/train/javascript
See lessShort Long Short codewars js
function solution(a, b){ return a.length < b.length ? a + b + a : b + a + b; }
See lessfunction solution(a, b){
return a.length < b.length ? a + b + a : b + a + b;
}
Count of positives sum of negatives.js
Stackoverflow question https://stackoverflow.com/questions/42190533/codewars-challenge-count-of-positives-sum-of-negatives/69093818#69093818 function countPositivesSumNegatives(input) { if (input === null || input.length < 1) { return []; } var array = [0, 0]; for(var i = 0; i <Read more
Stackoverflow question https://stackoverflow.com/questions/42190533/codewars-challenge-count-of-positives-sum-of-negatives/69093818#69093818
See lessfunction countPositivesSumNegatives(input) {
if (input === null || input.length < 1) {
return [];
}
var array = [0, 0];
for(var i = 0; i < input.length; i++) {
if(input[i] <= 0) {
array[1] += input[i];
} else {
array[0] += 1;
}
}
return array;
}
Reversed sequence javascript codewars 8 kyu
const reverseSeq = n => { return Array(n).fill(0).map((e, i) => n - i ); }; Video solution https://www.youtube.com/watch?v=y1jgbZ8lt1s
const reverseSeq = n => {
return Array(n).fill(0).map((e, i) => n - i );
};
Video solution
See lesshttps://www.youtube.com/watch?v=y1jgbZ8lt1s
Logical calculator Codewars JS 8 kyu
function logicalCalc(array, op) { var result = array[0]; for(var i = 1; i < array.length; i++) { if(op == "AND") { result = result && array[i]; } if(op == "OR") { result = result || array[i]; } if(op == "XOR") { result = result != array[i]; } } return result;Read more
See lessfunction logicalCalc(array, op) {
var result = array[0];
for(var i = 1; i < array.length; i++) {
if(op == "AND") {
result = result && array[i];
}
if(op == "OR") {
result = result || array[i];
}
if(op == "XOR") {
result = result != array[i];
}
}
return result;
}
Hex to Decimal
function hexToDec(hexString){ return parseInt(hexString, 16); } The parseInt() function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems). https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt?Read more
function hexToDec(hexString){
return parseInt(hexString, 16);
}
The
parseInt()
function parses a string argument and returns an integer of the specified radix (the base in mathematical numeral systems).https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt?retiredLocale=uk
See less