What goes in the blank?
// returns the string with leading/trailing spaces removed
function clean(s) {
return s.____();
}
// clean(" hi ") -> "hi"
Answer: trim
trim() removes whitespace from both ends of a string.
Play Problem Solving ▸
// returns the string with leading/trailing spaces removed
function clean(s) {
return s.____();
}
// clean(" hi ") -> "hi"
Answer: trim