Avoid Array.prototype.fill()

nolan/hinaloe-test
Jakob Krigovsky 2017-06-23 11:29:01 +02:00
parent 1b9b8983bb
commit 435250f319
2 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,8 @@ export default class Skins extends React.Component {
return <div>
<div className={`emoji-mart-skin-swatches ${opened ? 'emoji-mart-skin-swatches-opened' : ''}`}>
{Array(6).fill().map((_, i) => {
{/* Use Array.prototype.fill() when it is more widely supported. */}
{[...Array(6)].map((_, i) => {
var skinTone = i + 1,
selected = skinTone == skin

View File

@ -37,7 +37,8 @@ function get(perLine) {
if (!frequently) {
defaults = {}
return Array(perLine).fill('').map((_, i) => {
// Use Array.prototype.fill() when it is more widely supported.
return [...Array(perLine)].map((_, i) => {
defaults[DEFAULTS[i]] = perLine - i
return DEFAULTS[i]
})