Skip to content

Latest commit

 

History

History
16 lines (11 loc) · 836 Bytes

File metadata and controls

16 lines (11 loc) · 836 Bytes

Here are some simple javaScript problem-solving solutions. It's for beginners.

AnimalCount

Suppose you are going through a jungle. Now there are many animals around you. You want to count these. But the number of creatures is growing as deep as you want. The first 10 miles have 50 animals per mile The next 10 miles have 100 animals per mile. And then there are 200 animals per mile as you go. Now how to calculate these is shown inside animalCount.

arrayMax

arrayMax lets you easily find the largest array in any of your arrays.

arraySum

You can find the sum of all the numbers in an array.

duplicate

An easy solution is to delete a number or a string twice or more if it is in an array

swap

You can do this if you want to swap the value of one var to another var.