I
Size: a a a
I
KR
N
TS
const bytesToSize = bytes => { ... }
TS
A
return rate > 0
? `${size}${markers[rate]}b`
: `${size}${markers[rate]}`
;
return `${size}${markers[rate]}${rate > 0 : 'b' : ''}`;
const SIZE_UNITS = ['', ' Kb', ' Mb', ' Gb', ' Tb', ' Pb', ' Eb', ' Zb', ' Yb'];
const bytesToSize = bytes => {
if (bytes === 0) return '0';
const exp = Math.floor(Math.log(bytes) / Math.log(1000));
const size = bytes / 1000 ** exp;
const short = Math.round(size, 2);
const unit = SIZE_UNITS[exp];
return short + unit;
};
const bytesToSize = bytes => { ... }
bytesToSize
- это ведь объект в итоге.AK
const bytesToSize = bytes => { ... }
bytesToSize
- это ведь объект в итоге.TS
const bytesToSize = bytes => { ... }
bytesToSize
- это ведь объект в итоге.M
TS
TS
return rate > 0
? `${size}${markers[rate]}b`
: `${size}${markers[rate]}`
;
return `${size}${markers[rate]}${rate > 0 : 'b' : ''}`;
const SIZE_UNITS = ['', ' Kb', ' Mb', ' Gb', ' Tb', ' Pb', ' Eb', ' Zb', ' Yb'];
const bytesToSize = bytes => {
if (bytes === 0) return '0';
const exp = Math.floor(Math.log(bytes) / Math.log(1000));
const size = bytes / 1000 ** exp;
const short = Math.round(size, 2);
const unit = SIZE_UNITS[exp];
return short + unit;
};
TS
A
Object.getOwnPropertyDescriptors((() => {}))
==>length: {...}
name: {...}
__proto__: Object
AK
M
N
Object.getOwnPropertyDescriptors((() => {}))
==>length: {...}
name: {...}
__proto__: Object
A
TS
Object.getOwnPropertyDescriptors((() => {}))
==>length: {...}
name: {...}
__proto__: Object
N