JavaScript .codePointAt metgod

The snippet below is from a larger codeblock of a project, the job of the snippet is to get the unicode values of each character and it works fine execpt from numbers 1 - 9 ( 0 works too ) which return undefined.

const icons = '$677y8';
for(let i = 0; i < icons.length; i++){

console.log(icons.codePointAt(icons[i]));
}

Also, i tried charCodeAt() method
it returns NaN

const icons = '$677y8';
for(let i = 0; i < icons.length; i++){

console.log(icons.charCodeAt(icons[i]));
}

Is there another standard JavaScript method to get this done?

codePointAt and charCodeAt both expect a number (a position/index) as the argument. You are passing in the individual characters in the icons string as parameters.