CSS
- 22 ответа
- 0 вопросов
17
Вклад в тег
const arr = [{a:5},{d:6},{g:0},{b:3},{c:1}];
let max = null;
let result;
for (const currentObj of arr) {
const currentValue = currentObj[Object.keys(currentObj)[0]];
const currentKey = Object.keys(currentObj)[0];
if (max < currentObj[currentKey] || max === null) {
max = currentValue;
result = currentKey;
}
}
console.log(result);
<button><span>BUY NOW</span></button>
button{
border: 1px solid #ffffff;
padding-left: 40px;
padding-right: 40px;
padding-top: 10px;
padding-bottom: 10px;
background: none;
transform: skewX(-15deg);
}
span {
transform: skewX(15deg);
font-size: 18px;
color: rgb(255, 255, 255);
text-transform: uppercase;
display:block;
}