Message from JavaScript discussions

June 2019

— Hi everyone

— 

Hi everyone, I am making a chrome extension to blur the bad words on webpages and came across this problem https://stackoverflow.com/questions/56606406/chrome-extensions-content-script-makes-the-page-load-slow-on-some-websites-pos

Would be very grateful if you guys take some time and try to help me :)

— Hi HotBoy_178 This is because you have the script before the content you want to include script after the footer or ensure that script executes after content is loaded by using "DOMContentloaded" or document.ready function

Message permanent page

— Why ['1', '7', '11'].map(parseInt) returns [1, NaN, 3] in Javascript

— parseInt(string, radix)

— Coz parseInt has two parameters

— I guess it's considering 1 and 11 as binary hence converting to 1 and 3 while 7 is not in binary hence NaN

Message permanent page

— Radix is between 2 and 36

— Https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt

— Elaborate please

— I still didn't got you

— U can write in this way
['1','7','11'].map((item,index,array)=>{
return parseInt(item,index)
})