Check if a String Contains only Identical Characters

Published by Matt in

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

Watch a quick demo on how Edabit works.