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.
We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
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
const operations = { AND: (a, b) => a && b, OR: (a, b) => a || b, XOR: (a, b) => a !== b, } const logicalCalc = (array, op) => array.reduce(operations[op])
const operations = {
AND: (a, b) => a && b,
OR: (a, b) => a || b,
XOR: (a, b) => a !== b,
}
const logicalCalc = (array, op) => array.reduce(operations[op])
See lessFind the smallest integer in the array JS Codewars 8 kyu
Solution class SmallestIntegerFinder { findSmallestInt(args) { return Math.min(...args) } }
Solution
See lessclass SmallestIntegerFinder {
findSmallestInt(args) {
return Math.min(...args)
}
}