Open this example in the interactive library
Source code
const before = 80,
after = 100;
console.log(((after - before) / before) * 100);
Sample output
25

Calculate a percentage change. A self-contained example using the JavaScript runtime.
Open this example in the interactive library
const before = 80,
after = 100;
console.log(((after - before) / before) * 100);
25