# 学以致用
# 返回绝对类型
function type(name) {
return Object.prototype.toString.call(name).slice(8, -1)
}
# URL参数解析
// https://raindays.cn?name=libai&age=20&job=teacher
function urlParse(url) {
const res = new Object();
const arr = url.substr(url.indexOf('?') + 1).split('&');
arr.forEach(item => {
let tmp = item.split('=');
res[tmp[0]] = tmp[1]
})
return res
}