Skip to content

Commit

Permalink
Avoid Array.prototype.fill()
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicdoe committed Jun 23, 2017
1 parent 1b9b898 commit 435250f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/skins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion src/utils/frequently.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
})
Expand Down

0 comments on commit 435250f

Please sign in to comment.