분류
javascript
Javascript 30초 Snippet - Type : isString
본문
주어진 인수가 문자열인지 확인합니다. 문자열 프리미티브에만 작동합니다.
https://github.com/30-seconds/30-seconds-of-code
typeof를 사용하여 값이 문자열 프리미티브로 분류되는지 확인하십시오.
const isString = val => typeof val === 'string';
ex)
isString('10'); // true
- 이전글Javascript 30초 Snippet - Type : isSymbol 19.11.25
- 다음글Javascript 30초 Snippet - Type : isPromiseLike 19.11.25