📝

Get Type

Get Type
입문 기초 문법 +5pts

Problem

Write a function that returns the type of the given value.

Examples

Input: getType(42)
Output: "number"
Input: getType("hello")
Output: "string"

Explanation

이 문제는 **typeof 연산자**를 사용하여 JavaScript의 데이터 타입을 확인하는 방법을 학습합니다. **typeof 연산자** 값의 타입을 문자열로 반환합니다: - typeof 42 → "number" - typeof "hello" → "string" - typeof true → "boolean" **JavaScript의 기본 타입** - `"number"`: 숫자 (정수, 소수, NaN, Infinity) - `"string"`: 문자열 - `"boolean"`: true 또는 false - `"undefined"...

View detailed explanation →

Key Concepts

typeof 연산자 JavaScript 데이터 타입 동적 타이핑 타입 확인
Time: O(1) Space: O(1)
solution.js
Ctrl + Enter
Run tests to see results here.