← Back to challenges

Check if a String Contains only Identical Characters

JavaScriptHardstringsvalidation

Instructions

Write a function that returns true if all characters in a string are identical and false otherwise.

Examples

isIdentical("aaaaaa") ➞ true

isIdentical("aabaaa") ➞ false

isIdentical("ccccca") ➞ false

isIdentical("kk") ➞ true

Notes

N/A

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Basic Statistics: Mean