Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Объект который итерируем ---> this.circleUserInfo.stats
- // Заменяем нижнее подчеркивание ---> sortable.push([key.replace('_', ' '), props[key]]);
- newScorableArray() {
- if (!this.circleUserInfo.stats)
- return [[,]];
- let sortable = [];
- const props = extractProperties(this.circleUserInfo.stats);
- for (let key in props) {
- if (props.hasOwnProperty(key))
- sortable.push([key.replace('_', ' '), props[key]]);
- }
- return sortable
- .sort((a, b) => b[1] - a[1])
- .splice(0, 5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement