Allocamelus / Allocamelus

Operands must both be numbers or strings in addition expressions JS-0377
Anti-pattern
Minor
2 years ago2 years old
Operands to the + operator should be both numbers or both strings
 8
 9  const i = Math.floor(Math.log(bytes) / Math.log(k));
10
11  return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + " " + sizes[i];12}
13
14export default FormatBytes;