Is the Last Character an "N"?

Published by Matteo Matt in

Create a function that takes a string (a random name). If the last character of the name is an "n", return true, otherwise return false.

Examples

isLastCharacterN("Aiden") ➞ true

isLastCharacterN("Piet") ➞ false

isLastCharacterN("Bert") ➞ false

isLastCharacterN("Dean") ➞ true

Notes

The last character is always lowercase. The function must return a boolean value ( i.e. true or false).

Watch a quick demo on how Edabit works.