function type(target){
var tpf = typeof target;
var template = {
"[object Array]":'array',
"[object Object]":'object',
"[object String]":'string - object',
"[object Number]":'number - object',
"[object Boolean]":'boolean - object'
}
if(target === null){
return 'null';
}else if(tpf === 'object'){
return template[Object.prototype.toString.call(target)]
}else{
return tpf;
}
}
function retBytes(str){
var num = str.length;
for(var i;i<str.length;i++){
if(str.charCodeAt(i)>255){
num++;
}
}
return num;
}