- JavaScript 4©2ch.net
81 :デフォルトの名無しさん[sage]:2015/02/19(木) 00:01:52.76 ID:4zgsUurY - >>79
直した…スマソ function test(hoge, foo) { 'use strict'; if (typeof hoge === 'boolean') { console.log('hoge is', hoge); } else if (hoge && typeof hoge === 'object') { if (hoge.hasOwnProperty('hoge') && typeof hoge.hoge === 'boolean') { console.log('hoge is', hoge.hoge); } if (hoge.hasOwnProperty('foo') && typeof hoge.foo === 'boolean') { console.log('foo is', hoge.foo); } } }
|