Why does this JavaScript substring vs substr deprecated?

Why does this JavaScript substring vs substr giving different results. The JavaScript code uses substr which is deprecated and has different semantics. In JavaScript substr start and length vs substring start and end.

#whatswrongwiththisjavascriptcode #javascriptbug #javascriptproductionbug #javascriptdebugging #javascriptbackend #javascriptcodereview #javascriptsecurity #javascriptperforma...

https://www.youtube.com/watch?v=NuJUpsP2c4E

Why does this JavaScript substring vs substr deprecated? #javascriptperformance

YouTube