← Back to challenges

Find the Amount of Potatoes

JavaScriptHardstringslanguage_fundamentalsregex

Instructions

Create a function to return the amount of potatoes there are in a string.

Examples

potatoes("potato") ➞ 1

potatoes("potatopotato") ➞ 2

potatoes("potatoapple") ➞ 1

Notes

N/A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Slightly Superior