Test case details

Preparation Code

var type = typeof 1;

Test cases

Test #1

switch (type) { case 'boolean':   r = 'boolean';   break; case 'function':   r = 'function';   break; case 'object':   r = 'object';   break; case 'string':   r = 'string';   break; case 4:   r = 4;   break; case 'number':   r = 'number';   break; default:   r = "default";   break; }

Test #2

if (type === 'boolean') {   r = 'boolean'; } else if (type === 'function') {   r = 'function'; } else if (type === 'object') {   r = 'object'; } else if (type === 'string') {   r = 'string'; } else if (type === 4) {   r = 4; } else if (type === 'number') {   r = 'number'; } else {   r = "default" }