Interview of Chinese IT companies Ratings and Reviews website/app


Interview of Chinese IT companies Ratings and Reviews website/app

💩💩💩💩💩
👍👍👍👍👍
👎👎👎👎👎

// js hack

const getShitRank = (strings, ...values) => {
   let str = `★★★★★☆☆☆☆☆`;
   const rate = values[0] || 0;
   if(strings[0]) {
     str = strings[0];
   }
   return str.slice(5 - rate, 10 - rate);;
}

getShitRank`👍👍👍👍👍👎👎👎👎👎${1}`;
getShitRank`💩💩💩💩💩👎👎👎👎👎 ${1}`;
getShitRank`🍅🍅🍅🍅🍅💩💩💩💩💩 ${1}`;

emoji bug

Unicode bug???

// emoji bug
`🍅🍅🍅🍅🍅💩💩💩💩💩`.slice(4, 9)
// "🍅🍅�"
`🍅🍅🍅🍅🍅⭐️⭐️⭐️⭐️⭐️`.slice(4, 9)
// "🍅🍅�"

`★★★★★☆☆☆☆☆`.slice(4, 9)
// "★☆☆☆☆"

solution OK


const getShitRanking = (strings, ...values) => {
   const rate = values[0] || 0;
   let str = `★★★★★☆☆☆☆☆`;
   let start = 5 - rate;
   let end = 10 - rate;
   if(strings[0]) {
     str = strings[0].trim();
     start = (5 - rate) * (Math.ceil(str.length/10));
     end = (10 - rate) * (Math.ceil(str.length/10));
   }
   return str.slice(start, end);;
}


getShitRank`👍👍👍👍👍👎👎👎👎👎${1}`;
// "👍👎👎👎👎"
getShitRank`💩💩💩💩💩👎👎👎👎👎 ${1}`;
// "💩👎👎👎👎"
getShitRank`🍅🍅🍅🍅🍅💩💩💩💩💩 ${1}`;
// "🍅💩💩💩💩"

refs

Rotten Tomatoes (爛番茄)

https://www.rottentomatoes.com/

兩種評分體系:

TOMATOMETER® 番茄值 --- 對應專業評審評分

AUDIENCE SCORE 爆米花值 --- 對應普通觀眾評分

https://www.jianshu.com/p/32efef9d9714

douban 豆瓣


Flag Counter

©xgqfrms 2012-2020

www.cnblogs.com 發布文章使用:只允許注冊用戶才可以訪問!



免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM