Hirdetés
- Milyen okostelefont vegyek?
- Kicsomagoljuk és bemutatjuk a Poco F8 Ultrát
- Xiaomi 15T - reakció nélkül nincs egyensúly
- Apple Watch
- Mobil flották
- Megérkezett Magyarországra a Poco F8 Pro is
- Ezek a OnePlus 12 és 12R európai árai
- One mobilszolgáltatások
- LG V30 - vezércsel
- Samsung Galaxy Watch6 Classic - tekerd!
-
Mobilarena
JavaScript != Java (A JavaScript nem összekeverendő a Javával, két különböző programozási nyelvről van szó!)
Új hozzászólás Aktív témák
-
Jim-Y
veterán
válasz
martonx
#5452
üzenetére
Felig meddig igazad van, a typeof az onmagaban broken es tipus vizsgalatra nem javallott. Egy dologra alkalmas, undefined vizsgalatra
Bar en arra is inkabb explicitebb megoldast valasztanek pl
valami === void 0 de ez egyeni preferencia.Kb jQuery + underscore + lodash-bol osszeollozva
function isString(obj) {
return $.type(obj) === 'string';
}
function isNumber(obj) {
return exist(obj) && $.isNumeric(obj);
}
function isBoolean(obj) {
return obj === true || obj === false || $.type(obj) === 'boolean';
}
function isArray(obj) {
return exist(obj) && $.isArray(obj);
}
function isFunction(obj) {
return $.type(obj) === 'function';
}
function isDate(obj) {
return $.type(obj) === 'date';
}
function isRegExp(obj) {
return $.type(obj) === 'regexp';
}
function isError(obj) {
return toString.call(obj) === '[object Error]';
}
function isUndefined(obj) {
return obj === void 0;
}
function isNull(obj) {
return obj === null;
}
function isEmpty(obj) {
if (!exist(obj)) {
return true;
}
if (isNumber(obj) || isBoolean(obj) ) {
return false;
}
if (isArray(obj) || isString(obj) || toString.call(obj) === '[object Arguments]') {
return obj.length === 0;
}
return $.isEmptyObject(obj);
}
function exist(obj) {
return !isNull(obj) && !isUndefined(obj);
}
Új hozzászólás Aktív témák
- HIBÁTLAN iPhone 15 Pro Max 256GB Blue Titanium -1 ÉV GARANCIA -Kártyafüggetlen, 100% Akkumulátor
- TP-Link Archer C1200 Wireless Dual Band Gigabit Router v2.0
- Microsoft: Windows / Office / Server / Stb.
- AKCIÓ! Apple Mac Studio M1 MAX 2022 32GB 512GB számítógép garanciával, hibátlan működéssel
- HIBÁTLAN iPhone 14 Pro Max 128GB Gold -1 ÉV GARANCIA - Kártyafüggetlen, MS3910, 100% Akksi
Állásajánlatok
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
Cég: ATW Internet Kft.
Város: Budapest
Bar en arra is inkabb explicitebb megoldast valasztanek pl

