We're a place where coders share, stay up-to-date and grow their careers.
yup, a solution would be to add a return before the console.warn then it would return undefined
console.warn
undefined
if (str.length <= 3) return console.warn("your string should be at least 3 characters long and its length is", str.length)
yup,
a solution would be to add a return before the
console.warn
then it would returnundefined