简体   繁体   中英

Override javascript conditional statement

I know it is possible to override functions in JS, however is it possible to override implementation of conditional statements like ''if''.

Update As asked by some comments, I am building a chrome extension goal is to log and edit when ever if statement is executed on a webpage.

You can't override conditionals directly.

If you want, you can wrap them in a function and then override the function, which might accomplish what you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM