标签:json item str color reac font too string iso
判断object
function isObject(obj){ return obj !== null && typeof obj===‘object‘ }
判断undefined
function isUndef(v){ return v===undefined || v===null }
判断非undefined
function isUndef(v){ return v!==undefined && v!==null }
转换成字符串
function toString(val){ return val == null? ‘‘: typeof val===‘object‘? JSON.stringify(val): String(val); }
数组转换成对象
function toObject(arr){ var res={}; arr.forEach((item,index)=>{ res[index]=item; }); return res }
标签:json item str color reac font too string iso
原文地址:https://www.cnblogs.com/jingouli/p/11811201.html