Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

32장 String #33

Open
humonnom opened this issue Apr 23, 2022 · 0 comments
Open

32장 String #33

humonnom opened this issue Apr 23, 2022 · 0 comments
Assignees

Comments

@humonnom
Copy link
Collaborator

  • String의 래퍼객체는 읽기 전용이다.

    • 배열에는 원본 배열을 직접 변경하는 mutator method와 새로운 배열을 생성하여 반환하는 accessor method가 있다.(변경자/접근자)
    • 하지만 String 객체의 메서드는 언제나 새로운 문자열을 반환한다.
    • 문자열은 변경 불가능한 원시값이기 때문이다.
    • String 래퍼 객체도 읽기 전용 객체로 제공됨
  • charAt, charCodeAt, charPointAt

const icons = '☃★♲';

console.log(icons.charAt(1));
console.log(icons.charCodeAt(1));
console.log(icons.codePointAt(1));
  • charAt (Full support)
    • charAt() 함수는 문자열에서 특정 인덱스에 위치하는 유니코드 단일문자를 반환합니다.
  • charCodeAt (Full support)
    • charCodeAt() 메서드는 주어진 인덱스에 대한 UTF-16 코드를 나타내는 0부터 65535 사이의 정수를 반환합니다.
    • 9733
  • charPointAt (IE 빼고 Full support)
    • 9733
      스크린샷 2022-04-23 오후 6 10 16
@humonnom humonnom changed the title 36장 String 32장 String Apr 23, 2022
@humonnom humonnom self-assigned this Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant