String.charAt(index)

2023. 5. 5. 10:52·javascript

charAt() 함수는 문자열에서 특정 인덱스에 위치하는 유니코드 단일문자를 반환한다. 

사실 이 함수를 사용하지 않고 String[index]로도 사용할 수있다. 

const sentence = 'The quick brown fox jumps over the lazy dog.';

const index = 4;

console.log(`The character at index ${index} is ${sentence.charAt(index)}`);
// Expected output: "The character at index 4 is q"

 

'javascript' 카테고리의 다른 글

클로저  (0) 2025.01.02
string 대문자, 소문자 체크하기  (0) 2023.05.05
배열의 두 요소 순서를 변경할 때  (0) 2023.05.05
Array.prototype.reduce()  (0) 2023.04.20
call, bind, apply의 this binding  (0) 2023.04.19
'javascript' 카테고리의 다른 글
  • 클로저
  • string 대문자, 소문자 체크하기
  • 배열의 두 요소 순서를 변경할 때
  • Array.prototype.reduce()
ssund
ssund
  • ssund
    ssund의 기술블로그
    ssund
  • 전체
    오늘
    어제
    • TECH (82)
      • Next.js (8)
      • React (25)
      • Vite (1)
      • javascript (17)
      • CSS (6)
      • CS (10)
      • AWS (0)
      • Jest (1)
      • CI|CD (0)
      • 알고리즘 (8)
      • Tools (1)
      • Tips (5)
  • 블로그 메뉴

    • 링크

    • 공지사항

    • 인기 글

    • 태그

      nextjs
      타입스크립트
      커머스프로젝트
      redux
      서버컴포넌트
      react state management
      call signatures
      배열요소순서
      app-router
      웹브라우저구성
      React
      global-style
      theme-provider
      reat-head
      Array.sort()
      TypeScript
      JavaScript
      styled-components
      git배포
      함수와 메서드차이
    • 최근 댓글

    • 최근 글

    • hELLO· Designed By정상우.v4.10.0
    ssund
    String.charAt(index)
    상단으로

    티스토리툴바