0

Sorry for such silly question, but I am new to javascript and frontend development and struggling with understanding how the javascript code executes in browser. In my developer environment, I have javascript function like this:

this.publishDataBeforeDispose = function() {
            if (!this.isEnded) {
                segmentStop_();
                publishFinalData_();
            }

However, If I go to prod webpage of our website and try to search across all javascript files in Chrome's Source tab in Dev console, the code there looks like this:

this.publishDataBeforeDispose = function() {
    this.isEnded || (n(),
    w())
} 

What is the n() and w() stands for? How can I get to publishFinalData_() method in order to put breakpoint inside this method or change the code of this function right in browser?

Also, I noticed, that js code in the Source tab has different variables like "a","c","e","d":

  a.publish(),
  c = d("someValue1", "", 1),
  e(c),
  c = d("someValue2", "", b),
  e(c),

How this happens? Is there any online resources that can help me answer my whys for dummies like me?

WomenWhoCode
  • 396
  • 1
  • 6
  • 18

1 Answers1

1

The source code in browser is compressed, and all the scoped function's name and the variable's name have been replaced by simple words. If you want to debug, you can operate before it was compressed. You can debug in local code before publish online.

tinwan
  • 307
  • 1
  • 4