πŸ“

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.