function findShort(s){ return Math.min(...s.split(" ").map (s => s.length)); } var p1 = findShort("bitcoin take over the world maybe who knows perhaps"); //3 var p2 = findShort("turns out random test cases are easier than writing out basic ones") //3 console.log(p1); //3 console.log(p2); //3
找出最短的长度的字符串,这里的...起到什么作用?这好像不是类数组把。。
付费偷看金额在0.1-10元之间
一周热门 更多>