截取七牛上传图片的后缀名: export function getInputKey(info){ let self = this; let obj = JSON.parse(info); let qiniuKey; let imaName; let imgSuffix; if(obj){ qiniuKey = obj.key; imaName = obj.fileName; imgSuffix = imaName.substring(imaName.lastIndexOf('.') + 1);…
数组去重: Array.prototype.unique1 = function () { var n = []; //一个新的临时数组 for (var i = 0; i < this.length; i++) //遍历当前数组 { //如果当前数组的第i已经保存进了临时数组,那么跳过, //否则把当前项push到临时数组里面 if (n.indexOf(this[i]) == -1) n.push(this[i]); } return n; } Array.prototype.unique2…
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String//返回对应索引的字符 chartAt() //返回对应所引的字符的统一码(Unicode value) charCodeAt() //Returns a non-negative integer that is the UTF-16 encoded code point value at the given posit…