superpowers
An agentic skills framework & software development methodology that works.
- 322k
- Shell
- MIT
- 2 wk ago
Hello JavaScript code newbie! In this repository I'm proposing you a series of coding challenges that will help you practice the basic language constructs and algorithms.
Repo jahidulislamzim/JavaScriptCodingChallenges, read from GitHub 1 min ago. jahidulislamzim has not joined Take My Repo.
jahidulislamzim/JavaScriptCodingChallenges is a public repo on GitHub by jahidulislamzim. Hello JavaScript code newbie! In this repository I'm proposing you a series of coding challenges that will help you practice the basic language constructs and algorithms. It declares no license on GitHub. Public does not mean open source: without a license, nobody is granted the right to reuse it. It is written mainly in JavaScript, has 236 stars and last changed on 2025-08-22. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-19.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
function addition(a, b) { //Write Your solution Here }; console.log(addition(10, 20)); // 30 console.log(addition(30, 20)); // 50 console.log(addition(10, 90)); // 100
function addition(a, b) { let add = a + b; return (add) };
function howManySeconds(hours) { //Write Your solution Here }; console.log(howManySeconds(12)); // 43200 console.log(howManySeconds(8)); // 28800 console.log(howManySeconds(3)); // 10800
function howManySeconds(hours) { let hoursToSeconds = (hours*3600); return(hoursToSeconds) };
function convert(minutes){ //Write Your solution Here }; console.log(convert(30)); // 1800 console.log(convert(10)); // 600 console.log(convert(20)); // 1200
function convert(minutes) { let seconds = minutes*60; return (seconds) };
function footballPoints(wins, draws, losses){ //Write Your solution Here }; console.log(footballPoints(4, 3, 1)); // 15 console.log(footballPoints(10, 5, 0)); // 35 console.log(footballPoints(11, 0, 9)); // 33
function footballPoints(wins, draws, losses) { let points = (wins*3) + (draws*1) + (losses*0) return(points) };
function bitwiseAND(n1, n2) { //Write Your solution Here }; function bitwiseOR(n1, n2) { //Write Your solution Here }; function bitwiseXOR(n1, n2) { //Write Your solution Here }; console.log(bitwiseAND(10, 20)); // 0 console.log(bitwiseOR(10, 20)); // 30 console.log(bitwiseXOR(10, 20)); // 30
function bitwiseAND(n1, n2) { let answer = n1 & n2; return (answer); }; function bitwiseOR(n1, n2) { let answer = n1 | n2; return (answer); }; function bitwiseXOR(n1, n2) { let answer = n1 ^ n2; return (answer); };
function getFirstValue(arr) { //Write Your solution Here }; console.log(getFirstValue(["Saab", "Volvo", "BMW"])); // Saab console.log(getFirstValue([3, 5, 1])); // 3 console.log(getFirstValue(['hello', 'world', 'welcome'])); // hello
function getFirstValue(arr) { return arr[0]; };
function addition(num){ //Write Your solution Here }; console.log(addition(5)); // 6 console.log(addition(100)); // 101 console.log(addition(99)); // 100
function addition(num) { let numPlusOne = num + 1; return(numPlusOne) };
function lessThan100(a, b){ //Write Your solution Here }; console.log(lessThan100(10, 20)); // true console.log(lessThan100(50, 60)); // false console.log(lessThan100(20, 50)); // true
function lessThan100(a, b) { if (a + b < 100) { return true; } else { return false; } };
function isSameNum(num1, num2){ //Write Your solution Here }; console.log(isSameNum(30, 30)); // true console.log(isSameNum(20, 40)); // false console.log(isSameNum(50, 50)); // true
function isSameNum(num1, num2) { if (num1 === num2){ return true; } else { return false; } };
function matchHouses(step){ //Write Your solution Here }; console.log(matchHouses(5)); // 26 console.log(matchHouses(0)); // 0 console.log(matchHouses(10)); // 51
function matchHouses(step){ if (step > 0) { let matchSticks = ((step*6) - (step -1)); return(matchSticks) } else { let matchSticks = 0; return (matchSticks) } };
function squared(a){ //Write Your solution Here }; console.log(squared(6)); // 36 console.log(squared(9)); // 81 console.log(squared(4)); // 16
function squared(a) { return (a*a); };
function findPerimeter(height, width){ //Write Your solution Here }; console.log(findPerimeter(20, 50)); // 140 console.log(findPerimeter(80, 30)); // 220 console.log(findPerimeter(10, 40)); // 100
function findPerimeter(height, width){ let perimeter = 2*(height + width); return (perimeter) };
function addUp(num){ //Write Your solution Here }; console.log(addUp(10)); // 55 console.log(addUp(40)); // 820 console.log(addUp(15)); // 120
function addUp(num) { let sum = 0; for (i = 0; i <= num; i++){ sum += i; } return(sum) };
function profitableGamble(prob, prize, pay){ //Write Your solution Here }; console.log(profitableGamble(2, 10, 20)); // false console.log(profitableGamble(5, 10, 40)); // true console.log(profitableGamble(6, 3, 30)); // false
function profitableGamble(prob, prize, pay){ if (prob*prize > pay) { return (true) } else { return (false) } };
function minMax(arr){ //Write Your solution Here }; console.log(minMax([2, -1, 5])); // [ -1, 5 ] console.log(minMax([0, 5, 2])); // [ 0, 5 ] console.log(minMax([2, -5, -1])); // [ -5, 2 ]
function minMax(arr){ arr.sort(function(a, b){return(a - b)}) return [arr[0], arr[arr.length - 1]] };
function canNest(arr1, arr2){ //Write Your solution Here }; console.log(canNest([3, 1], [4, 0])); // true console.log(canNest([9, 9, 8], [8, 9])); // false console.log(canNest([1, 2, 3, 4], [0, 6])); // true
function canNest(arr1, arr2) { arr1.sort(function(a,b){return(a - b)}); arr2.sort(function(a,b){return(a - b)}); let arr1MinMax = [arr1[0], arr1[arr1.length -1]]; let arr2MinMax = [arr2[0], arr2[arr2.length -1]]; if (arr1MinMax[0] > arr2MinMax[0] && arr1MinMax[1] < arr2MinMax[1]){ return true } else{ return false } };
function numberSquares(n){ //Write Your solution Here }; console.log(numberSquares(4)); // 30 console.log(numberSquares(5)); // 55 console.log(numberSquares(6)); // 91
function whichIsLarger(f, g){ //Write Your solution Here }; console.log(whichIsLarger(() => 25, () => 15)); // f console.log(whichIsLarger(() => 25, () => 25)); // neither console.log(whichIsLarger(() => 25, () => 50)); // g
function whichIsLarger(f, g){ if (f() > g()) { return ('f') } else if (g() > f()) { return ('g') } else if (f() === g()) { return ('neither') } };
function timeForMilkAndCookies(date){ //Write Your solution Here }; console.log(timeForMilkAndCookies(new Date(3000, 11, 24))); //true console.log(timeForMilkAndCookies(new Date(2013, 0, 23))); //false console.log(timeForMilkAndCookies(new Date(3000, 11, 24))); //true
function timeForMilkAndCookies(date){ return date.getMonth() === 11 && date.getDate() === 24; };
function largestSwap(num){ //Write Your solution Here }; console.log(largestSwap(14)); //false console.log(largestSwap(53)); //true console.log(largestSwap(-27)); //false
function largestSwap(num){ let num1 = num + ""; let num2 = num1.split("").reverse().join(""); if (num1 >= num2) { return true; } if (num1 < num2) { return false; } }; function largestSwap(num) { let c = num.toString(); let a = []; let b = 0; for (let i = 0; i < c.length; i++) { a.push(c[c.length - 1 - i]); b += a[i]; } let d = parseInt(b); if (d > num) { return false; } else return true; };
function charCount(myChar, str){ //Write Your solution Here }; console.log(charCount("a", "largest")); //1 console.log(charCount("c", "Chamber of secrets")); // 2 console.log(charCount("b", "big fat bubble")); //4
function charCount(myChar, str){ let a = 0; for (let i = 0; i < str.length; i++) { if (myChar.toLowerCase() === str.toLowerCase()[i]) { a += 1; } } return a };
function repetition(txt, n){ //Write Your solution Here }; console.log(repetition('zim', 5)); //zimzimzimzimzim console.log(repetition('zoy', 2)); //zoyzoy console.log(repetition('akib', 7)); //akibakibakibakibakibakibakib
function repetition(txt, n){ let reptxt = "" while (n > 0) { reptxt += txt n--; } return reptxt };
function filterArray(arr){ //Write Your solution Here }; console.log(filterArray([1, 'z', 4, 5, 'i', 9, 'm'])); //[ 1, 4, 5, 9 ] console.log(filterArray([8, 'z', 1, '8', 'i', 9, 'm'])); //[ 8, 1, 9 ] console.log(filterArray([7, '1', 'z', 0, 'i', 9, 'm'])); //[ 7, 0, 9 ]
function filterArray(arr){ let filteredArray = arr.filter(item => typeof item === "number"); return filteredArray }; function filterArray(arr) { let filteredArr = []; for (let i = 0; i < arr.length; i++) { if ( typeof arr[i] !== "string") { filteredArr.push(arr[i]) } } return filteredArr };
function matchFlag(str){ //Write Your solution Here }; console.log(matchFlag("yellow flag red flag blue flag green flag")); //[ 'red flag', 'blue flag' ] console.log(matchFlag("yellow flag green flag orange flag white flag")); //null console.log(matchFlag("yellow flag blue flag green flag")); //[ 'blue flag' ]
function matchFlag(str){ let REGEXP = /red flag|blue flag/g; return str.match(REGEXP); };
function matchEllipsis(str){ //Write Your solution Here }; console.log(matchEllipsis("Hello!... How goes?.....")); //[ '...', '.....' ] console.log(matchEllipsis("good morning!..... How goes?.")); // [ '.....' ] console.log(matchEllipsis("good night!.......... How goes?...")); // [ '..........', '...' ]
function matchEllipsis(str){ let REGEXP = /\.{3,}/g; return str.match(REGEXP); };
function flip(y){ //Write Your solution Here }; console.log(flip(1)); // 0 console.log(flip(0)); // 1
function flip(y){ let x = y - 1; return (Math.abs(x)) };
function doubleChar(str){ //Write Your solution Here }; console.log(doubleChar('jahidul')); //jjaahhiidduull console.log(doubleChar('islam')); //iissllaamm console.log(doubleChar('zim')); //zziimm
function doubleChar(str) { let doubleString = ''; for(let i=0; i<str.length; i++){ doubleString += str[i] + str[i] } return doubleString }; function doubleChar(str){ let array = str.split(""); let array2 = array.map( x => x.repeat(2)); let doubleString = array2.join(""); return doubleString };
function factorial(num){ //Write Your solution Here }; console.log(factorial(5)); //120 console.log(factorial(10)); //3628800 console.log(factorial(8)); //40320
function factorial(num) { let fact = 1; for (let i = 0; i<num ; i++){ fact *= (num-i); } return fact }; function factorial(num){ if (num < 0) return -1; else if (num == 0) return 1; else { return (num * factorial(num - 1)); } }; function factorial(num){ let result = num; if (num === 0 || num === 1) return 1; while (num > 1) { num--; result *= num; } return result; }; function factorial(num){ let fact = num; if (num === 0 || num === 1) return 1; for (let i = num - 1; i >= 1; i--) { fact *= i; } return fact; };
function getAbsSum(arr){ //Write Your solution Here }; console.log(getAbsSum([1, -4, 3, 8, 0])); // 16 console.log(getAbsSum([1, 3, 0, -8, 0])); // 12 console.log(getAbsSum([1, -4, -3, 8, 0])); //16
function getAbsSum(arr){ let absSum = 0; for (var i = 0; i < arr.length; i++) { absSum += Math.abs(arr[i]); } return absSum; };
function matchAny(str){ //Write Your solution Here }; console.log(matchAny('Csxdzontains_underscore ')); //[ '_' ] console.log(matchAny('Csxdzontains_underscore $ * P')); //[ '_', '$', '*' ]
function matchAny(str){ const REGEXP = /[^a-z0-9 ]/gi; return str.match(REGEXP) };
function countVowels(str){ //Write Your solution Here }; console.log(countVowels('Jahidul Islam zim')); // 6 console.log(countVowels('returns the number of vowels')); // 8 console.log(countVowels('JavaScript Coding Challenges')); // 8
function countVowels(str){ let count = 0; let vowlStr = str.toLowerCase().match(/(a|e|i|o|u)/g); for (let i = 0; i < vowlStr.length; i++) { count += 1; } return count; };
function isOrthogonal(arr1, arr2){ //Write Your solution Here }; console.log(isOrthogonal([1, -2, 4], [2, 5, 2])); //true console.log(isOrthogonal([1, -2, 5], [2, 5, 2])); //false console.log(isOrthogonal([1, 2, 4], [-2, 5, -2])); //true
function isOrthogonal(arr1, arr2){ let ortho = 0; for (i = 0; i < arr1.length; i++){ ortho += arr1[i]*arr2[i] } if (ortho === 0) { return true } return false };
function inkLevels(inks){ //Write Your solution Here }; console.log(inkLevels({ cyan: 50, magenta: 12, yellow: 60 })); // 12 console.log(inkLevels({ cyan: 50, magenta: 120, yellow: 60 })); // 50 console.log(inkLevels({ cyan: 50, magenta: 12, yellow: 8 })); // 8
function inkLevels(inks){ return Math.min(...Object.values(inks)); };
function removeVowels(str){ //Write Your solution Here }; console.log(removeVowels('Jahidul Islam Zim')); //Jhdl slm Zm console.log(removeVowels('a new string with all vowels')); // nw strng wth ll vwls console.log(removeVowels('Create a function')); //Crt fnctn
function removeVowels(str){ let newArr = str.match(/[^aeiouAEIOU]/g); let newString = newArr.join(''); return newString };
function findLargestNums(arr){ //Write Your solution Here }; console.log(findLargestNums([[3,6], [10, 20], [-1, 7]])); //[ 6, 20, 7 ] console.log(findLargestNums([[8,6], [1, 0], [10, -7]])); //[ 8, 1, 10 ] console.log(findLargestNums([[3,34], [10, 22], [-1, -7]])); //[ 34, 22, -1 ]
function findLargestNums(arr){ let newArr = [] for (let i = 0; i < arr.length; i++) { newArr.push(Math.max(...arr[i])); } return newArr };
function maximumScore(tileHand){ //Write Your solution Here }; console.log( maximumScore([ { tile: "N", score: 1 }, { tile: "K", score: 5 }, { tile: "Z", score: 10 }, ]) ); //16 console.log( maximumScore([ { tile: "N", score: 9 }, { tile: "K", score: 5 }, { tile: "Z", score: 40 }, ]) ); //54 console.log( maximumScore([ { tile: "N", score: 1 }, { tile: "K", score: 65 }, { tile: "Z", score: 10 }, ]) ); //76
function maximumScore(tileHand){ let score = 0; for ( let i = 0; i < tileHand.length; i++) { score += tileHand[i].score; } return score; };
function isJS(path){ //Write Your solution Here }; console.log(isJS('file.jsx')); //true console.log(isJS('file.jsg')); //false console.log(isJS('file.js')); //true
function isJS(path){ let extension = path.match( /[^.]+$/g)[0] if(extension === 'js' || extension==='jsx'){ return true; } return false; };
function animals(chickens, cows, goats){ //Write Your solution Here }; console
jahidulislamzim/JavaScriptCodingChallenges is a public repo on GitHub by jahidulislamzim. Hello JavaScript code newbie! In this repository I'm proposing you a series of coding challenges that will help you practice the basic language constructs and algorithms.
It declares no license on GitHub. Public does not mean open source: without a license, nobody is granted the right to reuse it.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
An agentic skills framework & software development methodology that works.

Its last change on GitHub was on 2025-08-22. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
This repository consists of materials for those preparing for coding tests and algorithm interviews.

A Collection of application ideas which can be used to improve your coding skills.

JavaScript interview Questions

A series of ReactJS coding challenges with a variety of difficulties.
This page is also available as structured data, with the same sources and dates.
/api/v1/resources/gh/jahidulislamzim/JavaScriptCodingChallengesTake My Repo has not tested this on your machine. Requirements come from the project's own documentation.
