181908
Link
https://school.programmers.co.kr/learn/courses/30/lessons/181908 (opens in a new tab)
Answer
JavaScript
function solution(my_string, is_suffix) {
return my_string.endsWith(is_suffix) ? 1 : 0;
}
function solution(my_string, is_suffix) {
return Array.from(my_string)
.map((_, i) => my_string.substring(i))
.find((n) => n === is_suffix)
? 1
: 0;
}