Simple javascript rating stars

const r = s => `★★★★★☆☆☆☆☆`.slice(5 - s, 10 - s); console.log('Stars: ', r(3)); // Stars: ★★★☆☆
Simple vanilla javascript rating stars with slice() function

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.