📜

String Length

String Length
입문 문자열 +5pts

Problem

Write a function that returns the length of a string.

Examples

Input: strLength("hello")
Output: 5

Explanation

이 문제는 **문자열의 length 속성**을 사용하여 길이를 구하는 방법을 학습합니다. ## 핵심 개념: length 속성 JavaScript에서 문자열의 길이는 `length` 속성으로 간단히 얻을 수 있습니다. ### 기본 사용법 ```javascript str.length ``` - 메서드가 아닌 속성이므로 괄호()가 필요 없습니다 - 문자열의 문자 수를 반환합니다 ### 주의사항 ```javascript "hello".length // 5 "".length // 0 "안녕".length ...

View detailed explanation →

Key Concepts

length 속성 문자열 기초 속성 vs 메서드 유니코드 길이
Time: O(1) Space: O(1)
solution.js
Ctrl + Enter
Run tests to see results here.