![]() Calculate the sum of numbers received in a comma delimited stringĮdit in coding playground println(sumCSV("1.5, 2.3, 3.1, 4, 5.5, 6, 7, 8, 9, 10.9")) Ĭoding challenge #34. If (!isSeparator(currChr) & isSeparator(prevChr))Ĭoding challenge #33. If (text.length > 0 & !isSeparator(text)) Create a function that will return the number of words in a text Println(countWords("I like to learn JavaScript with codeguppy")) Ĭoding challenge #31b. Println(countWords(" JavaScript is cool ")) set that the previous character was separator if current character is separator then advance and Let s2 = sNumber2.padStart(maxSize, "0") Ĭoding challenge #31a. Let s1 = sNumber1.padStart(maxSize, "0") Let maxSize = Math.max(sNumber1.length, sNumber2.length) The numbers are received as strings and the result should be also provided as string. ![]() ![]() Let ar = Ĭoding challenge #12: Create a function that receives an array of numbers and returns an array containing only the positive numbers Solution 2Įdit in coding playground function getPositives(ar)Ĭoding challenge #12: Create a function that receives an array of numbers and returns an array containing only the positive numbers Solution 3Ĭoding challenge #13: Find the maximum number in an array of numbersĮdit in coding playground function findMax(ar)Ĭoding challenge #14: Print the first 10 Fibonacci numbers without recursionĮdit in coding playground let s = reverseString("JavaScript") Ĭoding challenge #24: Create a function that will merge two arrays and return the result as a new arrayĮdit in coding playground let ar1 = Ĭoding challenge #25: Create a function that will receive two arrays of numbers as arguments and return an array composed of all the numbers that are either in the first array or second array but not in bothĬoding challenge #26: Create a function that will receive two arrays and will return an array with elements that are in the first array but not in the secondĬoding challenge #27: Create a function that will receive an array of numbers as argument and will return a new array with distinct elements Solution 1Įdit in coding playground let ar = getDistinctElements() Ĭoding challenge #30-b: Create a function that will add two positive numbers of indefinite size. Coding challenge #1: Print numbers from 1 to 10Įdit in coding playground for(let i = 1 i = 0) If you want to run these solutions outside CodeGuppy, just replace println() with console.log() then run them using your browser console tool or node.js. The code is making use of the codeguppy specific function println() to print the results. ![]() If you prefer to open all solutions in a single, unified coding playgroud please open the 50 Coding Challenges project. Each solution is acompanied by an online link that helps you quickly run it in a code playground. The coding challenges in this article are intended for code newbies, therefore the solutions are implemented using only simple / classical programming elements. You’ll find there a series of fun and engaging coding lessons and cool projects.Ĭhannel main page Coding lessons playlist Coding projects playlist After you read this article, please remember to check out also the “Coding Adventures” YouTube channel.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |