Anil Chaudhary
1 min readMay 29, 2018

--

Hi Nicolas Charpentier: I ran the above mentioned class in babel repl with ES2017 statge 2 preset and found out different outputs.

Here is the link for babel repl
https://babeljs.io/repl/#?babili=false&browsers=&build=&builtIns=false&code_lz=MYGwhgzhAECC0G8BQEAuZUEtjWAexDwCdoBeaAIiIFMATCgbiXwFcA7Vao0gBiYAswbWiGoBhENgDWZaAAoAlGQB8iJKn6YIAOlYcuAagNMAvkkHDRAGTxsA5hOmzFKtRq2687TkSOmkZvhsaNCo5GzUAO5wisy2EATU2oR2cqjaFiLUNvaOwFIKccGJyXip6ZmieQVAA&debug=false&forceAllTransforms=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&lineWrap=true&presets=es2017%2Creact%2Cstage-2&prettier=true&targets=&version=6.26.0&envVersion=

Both the value (handleClick and handleLongClick )will be undefined as we are defining any thing in A.protyotype. If we definne any function or variable in prototype, then only we we will be able to access them in prototype chain.

This is my understanding. Could you please comment on that ?.

--

--

Anil Chaudhary
Anil Chaudhary

Written by Anil Chaudhary

@Google Javascript | Developer Experience | Dev Rant

No responses yet