Skip to main content

All Questions

3 votes
2 answers
158 views

Basic Linked List Implementation in JavaScript

Clarification of Intent Recursion here is used on purpose for practice - note that iteration is preferred in this case (I'll be more clear about where my intentions are!) Factory function was also ...
bdng's user avatar
  • 39
6 votes
1 answer
112 views

Improving product configurator "algoritm"

I have created a product configurator in VueJS and the whole functionality of it runs on one single function. I've put the word algoritm in the title in quotes because I don't really know if it is ...
Rainier laan's user avatar
2 votes
1 answer
1k views

Codewars: Pick peaks

Pick peaks Wrote my "hello world" on Thursday, so definitely a beginner. I know some Python, so not a novice to programming in general. Question For example, the array ...
Tobi Alafin's user avatar
  • 1,792
3 votes
1 answer
104 views

Enhance function that justifies text

On Codewars, there is a challenge where the goal is to justify an str into a certain len. Here are the rules: Use spaces to ...
notak's user avatar
  • 605
2 votes
1 answer
166 views

Find closest elements in an array relative to given index with a bias to distance from index and direction

This function determines which images should be loaded based on which image is currently in the viewport (array index), what direction the user is scrolling, and if the image has yet to be loaded. It ...
dandan's user avatar
  • 155
1 vote
1 answer
367 views

Capitalize the First Letter of Words in a String (JavaScript, Python)

Problem Write a function that accepts a string, capitalizes the first letter of each word in the string, and returns the capitalized string. Examples ...
Emma's user avatar
  • 3,592
1 vote
1 answer
162 views

Anagram (Python, JavaScript)

Problem Write a function to check whether two given strings are anagram of each other or not. An anagram of a string is a string that contains same characters ([A-Za-z0-9]) and the order of ...
Emma's user avatar
  • 3,592
2 votes
3 answers
909 views

Split array into chunks (JavaScript, Python, PHP)

Problem Given a list and an integer chunk size, divide the list into sublists, where each sublist is of chunk size. Codes Just for practicing, I've coded to solve the problem using JavaScript and ...
Emma's user avatar
  • 3,592
3 votes
2 answers
1k views

Palindrome and Reverse a String Problems (JavaScript, Python)

Problem 1 Given a string, the task is to reverse the string and return a reversed string. Problem 2 Given a string, return true if the string is a palindrome or false if it is not. Code Just for ...
Emma's user avatar
  • 3,592
4 votes
2 answers
146 views

Find 4 points which form a square with the biggest area

I have set of points on the coordinate plane. I need to find the 4 points which form a square with the biggest area. I'm new in JavaScript so I'd like to get any suggestions about code style, ...
eanmos's user avatar
  • 405
3 votes
2 answers
2k views

JavaScript flood fill

I tried to implement a very simple color flood fill to experiment a bit with Javascript. All comments about the code are welcome but I am especially interested in performance as it seems to be a bit ...
Corporal Touchy's user avatar
3 votes
1 answer
2k views

JavaScript Determine if Number is Lucky

A challenge from Code Fights; a function that takes a number no less than 10 and that will always have an even number of digits and determines if the sum of the first half of the digits equals the sum ...
MadHatter's user avatar
  • 855
1 vote
1 answer
839 views

JavaScript Determine if Array has Almost Increasing Sequence

A coding challenge on a website says to determine if an array would have an increasing sequence if one element were removed from that array. Here is the function: ...
MadHatter's user avatar
  • 855
2 votes
2 answers
2k views

Determine if Array has an Increasing Sequence

I wrote a function in JavaScript that expects an array of integers (negative or positive) and determines if that array has an increasing sequence. For the sake of better time performance I made the ...
MadHatter's user avatar
  • 855
6 votes
1 answer
2k views

JS Tic Tac Toe using Minimax algorithm

To challenge myself, I set out to create a tic-tac-toe game, complete with a Minimax-driven AI. I had already attempted this challenge once when I was following the FreeCodeCamp curriculum. For this ...
Mart-Aleksander Lepanen's user avatar

15 30 50 per page