[{"data":1,"prerenderedAt":1170},["ShallowReactive",2],{"blog//blog/trace-js-function":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"duration":11,"body":12,"_type":1164,"_id":1165,"_source":1166,"_file":1167,"_stem":1168,"_extension":1169},"/blog/trace-js-function","blog",false,"","Trace Js Function","Trace where the function was called from, in javascript","1 Oct 2020",5,{"type":13,"children":14,"toc":1161},"root",[15,23,798,811,841,860,869,897,910,917,957,1013,1027,1048,1133,1140,1155],{"type":16,"tag":17,"props":18,"children":19},"element","p",{},[20],{"type":21,"value":22},"text","Hello, Today we are going to remind ourselves how we can trace a function so that we can know where it was called from. If you have not ever messed up while trying to find where a function was called from you can't understand how important this post is, but if you have messed up and struggled to know and find where exactly the function is called from and then here is the solution",{"type":16,"tag":24,"props":25,"children":29},"pre",{"className":26,"code":27,"language":28,"meta":7,"style":7},"language-vue shiki shiki-themes vitesse-dark","\u003Ctemplate>\n\u003CNuxtLayout>\n    \u003Cmain class=\"flex justify-center\">\n        \u003Csection class=\"max-w-xl\">\n        \u003C/section>\n    \u003C/main>\n\u003C/NuxtLayout>\n\u003C/template>\n\n\u003Cscript setup lang=\"ts\">\n\nconst route = useRoute()\nconst { data } = await useAsyncData(`blog/${route.path}`, () => queryContent(route.path).findOne())\n\nuseHead({\n    title: data.value.title,\n    meta:[\n        {\n            hid: 'description',\n            name: 'description',\n            content: data.value.description,\n          }\n    ]\n})\n\nonMounted(() => {\n    console.log(data.value)\n    console.log(route.path)\n})\n\n\u003C/script>\n","vue",[30],{"type":16,"tag":31,"props":32,"children":33},"code",{"__ignoreMap":7},[34,57,74,119,158,174,191,208,224,234,278,286,317,448,456,470,513,527,536,567,596,633,642,651,660,668,691,730,766,774,782],{"type":16,"tag":35,"props":36,"children":39},"span",{"class":37,"line":38},"line",1,[40,46,52],{"type":16,"tag":35,"props":41,"children":43},{"style":42},"--shiki-default:#666666",[44],{"type":21,"value":45},"\u003C",{"type":16,"tag":35,"props":47,"children":49},{"style":48},"--shiki-default:#4D9375",[50],{"type":21,"value":51},"template",{"type":16,"tag":35,"props":53,"children":54},{"style":42},[55],{"type":21,"value":56},">\n",{"type":16,"tag":35,"props":58,"children":60},{"class":37,"line":59},2,[61,65,70],{"type":16,"tag":35,"props":62,"children":63},{"style":42},[64],{"type":21,"value":45},{"type":16,"tag":35,"props":66,"children":67},{"style":48},[68],{"type":21,"value":69},"NuxtLayout",{"type":16,"tag":35,"props":71,"children":72},{"style":42},[73],{"type":21,"value":56},{"type":16,"tag":35,"props":75,"children":77},{"class":37,"line":76},3,[78,83,88,94,99,105,111,115],{"type":16,"tag":35,"props":79,"children":80},{"style":42},[81],{"type":21,"value":82},"    \u003C",{"type":16,"tag":35,"props":84,"children":85},{"style":48},[86],{"type":21,"value":87},"main",{"type":16,"tag":35,"props":89,"children":91},{"style":90},"--shiki-default:#BD976A",[92],{"type":21,"value":93}," class",{"type":16,"tag":35,"props":95,"children":96},{"style":42},[97],{"type":21,"value":98},"=",{"type":16,"tag":35,"props":100,"children":102},{"style":101},"--shiki-default:#C98A7D77",[103],{"type":21,"value":104},"\"",{"type":16,"tag":35,"props":106,"children":108},{"style":107},"--shiki-default:#C98A7D",[109],{"type":21,"value":110},"flex justify-center",{"type":16,"tag":35,"props":112,"children":113},{"style":101},[114],{"type":21,"value":104},{"type":16,"tag":35,"props":116,"children":117},{"style":42},[118],{"type":21,"value":56},{"type":16,"tag":35,"props":120,"children":122},{"class":37,"line":121},4,[123,128,133,137,141,145,150,154],{"type":16,"tag":35,"props":124,"children":125},{"style":42},[126],{"type":21,"value":127},"        \u003C",{"type":16,"tag":35,"props":129,"children":130},{"style":48},[131],{"type":21,"value":132},"section",{"type":16,"tag":35,"props":134,"children":135},{"style":90},[136],{"type":21,"value":93},{"type":16,"tag":35,"props":138,"children":139},{"style":42},[140],{"type":21,"value":98},{"type":16,"tag":35,"props":142,"children":143},{"style":101},[144],{"type":21,"value":104},{"type":16,"tag":35,"props":146,"children":147},{"style":107},[148],{"type":21,"value":149},"max-w-xl",{"type":16,"tag":35,"props":151,"children":152},{"style":101},[153],{"type":21,"value":104},{"type":16,"tag":35,"props":155,"children":156},{"style":42},[157],{"type":21,"value":56},{"type":16,"tag":35,"props":159,"children":160},{"class":37,"line":11},[161,166,170],{"type":16,"tag":35,"props":162,"children":163},{"style":42},[164],{"type":21,"value":165},"        \u003C/",{"type":16,"tag":35,"props":167,"children":168},{"style":48},[169],{"type":21,"value":132},{"type":16,"tag":35,"props":171,"children":172},{"style":42},[173],{"type":21,"value":56},{"type":16,"tag":35,"props":175,"children":177},{"class":37,"line":176},6,[178,183,187],{"type":16,"tag":35,"props":179,"children":180},{"style":42},[181],{"type":21,"value":182},"    \u003C/",{"type":16,"tag":35,"props":184,"children":185},{"style":48},[186],{"type":21,"value":87},{"type":16,"tag":35,"props":188,"children":189},{"style":42},[190],{"type":21,"value":56},{"type":16,"tag":35,"props":192,"children":194},{"class":37,"line":193},7,[195,200,204],{"type":16,"tag":35,"props":196,"children":197},{"style":42},[198],{"type":21,"value":199},"\u003C/",{"type":16,"tag":35,"props":201,"children":202},{"style":48},[203],{"type":21,"value":69},{"type":16,"tag":35,"props":205,"children":206},{"style":42},[207],{"type":21,"value":56},{"type":16,"tag":35,"props":209,"children":211},{"class":37,"line":210},8,[212,216,220],{"type":16,"tag":35,"props":213,"children":214},{"style":42},[215],{"type":21,"value":199},{"type":16,"tag":35,"props":217,"children":218},{"style":48},[219],{"type":21,"value":51},{"type":16,"tag":35,"props":221,"children":222},{"style":42},[223],{"type":21,"value":56},{"type":16,"tag":35,"props":225,"children":227},{"class":37,"line":226},9,[228],{"type":16,"tag":35,"props":229,"children":231},{"emptyLinePlaceholder":230},true,[232],{"type":21,"value":233},"\n",{"type":16,"tag":35,"props":235,"children":237},{"class":37,"line":236},10,[238,242,247,252,257,261,265,270,274],{"type":16,"tag":35,"props":239,"children":240},{"style":42},[241],{"type":21,"value":45},{"type":16,"tag":35,"props":243,"children":244},{"style":48},[245],{"type":21,"value":246},"script",{"type":16,"tag":35,"props":248,"children":249},{"style":90},[250],{"type":21,"value":251}," setup",{"type":16,"tag":35,"props":253,"children":254},{"style":90},[255],{"type":21,"value":256}," lang",{"type":16,"tag":35,"props":258,"children":259},{"style":42},[260],{"type":21,"value":98},{"type":16,"tag":35,"props":262,"children":263},{"style":101},[264],{"type":21,"value":104},{"type":16,"tag":35,"props":266,"children":267},{"style":107},[268],{"type":21,"value":269},"ts",{"type":16,"tag":35,"props":271,"children":272},{"style":101},[273],{"type":21,"value":104},{"type":16,"tag":35,"props":275,"children":276},{"style":42},[277],{"type":21,"value":56},{"type":16,"tag":35,"props":279,"children":281},{"class":37,"line":280},11,[282],{"type":16,"tag":35,"props":283,"children":284},{"emptyLinePlaceholder":230},[285],{"type":21,"value":233},{"type":16,"tag":35,"props":287,"children":289},{"class":37,"line":288},12,[290,296,301,306,312],{"type":16,"tag":35,"props":291,"children":293},{"style":292},"--shiki-default:#CB7676",[294],{"type":21,"value":295},"const ",{"type":16,"tag":35,"props":297,"children":298},{"style":90},[299],{"type":21,"value":300},"route",{"type":16,"tag":35,"props":302,"children":303},{"style":42},[304],{"type":21,"value":305}," =",{"type":16,"tag":35,"props":307,"children":309},{"style":308},"--shiki-default:#80A665",[310],{"type":21,"value":311}," useRoute",{"type":16,"tag":35,"props":313,"children":314},{"style":42},[315],{"type":21,"value":316},"()\n",{"type":16,"tag":35,"props":318,"children":320},{"class":37,"line":319},13,[321,325,330,335,340,344,349,354,359,364,369,374,378,383,388,393,397,402,407,412,417,421,425,429,433,438,443],{"type":16,"tag":35,"props":322,"children":323},{"style":292},[324],{"type":21,"value":295},{"type":16,"tag":35,"props":326,"children":327},{"style":42},[328],{"type":21,"value":329},"{",{"type":16,"tag":35,"props":331,"children":332},{"style":90},[333],{"type":21,"value":334}," data",{"type":16,"tag":35,"props":336,"children":337},{"style":42},[338],{"type":21,"value":339}," }",{"type":16,"tag":35,"props":341,"children":342},{"style":42},[343],{"type":21,"value":305},{"type":16,"tag":35,"props":345,"children":346},{"style":48},[347],{"type":21,"value":348}," await",{"type":16,"tag":35,"props":350,"children":351},{"style":308},[352],{"type":21,"value":353}," useAsyncData",{"type":16,"tag":35,"props":355,"children":356},{"style":42},[357],{"type":21,"value":358},"(",{"type":16,"tag":35,"props":360,"children":361},{"style":101},[362],{"type":21,"value":363},"`",{"type":16,"tag":35,"props":365,"children":366},{"style":107},[367],{"type":21,"value":368},"blog/",{"type":16,"tag":35,"props":370,"children":371},{"style":48},[372],{"type":21,"value":373},"${",{"type":16,"tag":35,"props":375,"children":376},{"style":107},[377],{"type":21,"value":300},{"type":16,"tag":35,"props":379,"children":380},{"style":42},[381],{"type":21,"value":382},".",{"type":16,"tag":35,"props":384,"children":385},{"style":107},[386],{"type":21,"value":387},"path",{"type":16,"tag":35,"props":389,"children":390},{"style":48},[391],{"type":21,"value":392},"}",{"type":16,"tag":35,"props":394,"children":395},{"style":101},[396],{"type":21,"value":363},{"type":16,"tag":35,"props":398,"children":399},{"style":42},[400],{"type":21,"value":401},",",{"type":16,"tag":35,"props":403,"children":404},{"style":42},[405],{"type":21,"value":406}," ()",{"type":16,"tag":35,"props":408,"children":409},{"style":42},[410],{"type":21,"value":411}," =>",{"type":16,"tag":35,"props":413,"children":414},{"style":308},[415],{"type":21,"value":416}," queryContent",{"type":16,"tag":35,"props":418,"children":419},{"style":42},[420],{"type":21,"value":358},{"type":16,"tag":35,"props":422,"children":423},{"style":90},[424],{"type":21,"value":300},{"type":16,"tag":35,"props":426,"children":427},{"style":42},[428],{"type":21,"value":382},{"type":16,"tag":35,"props":430,"children":431},{"style":90},[432],{"type":21,"value":387},{"type":16,"tag":35,"props":434,"children":435},{"style":42},[436],{"type":21,"value":437},").",{"type":16,"tag":35,"props":439,"children":440},{"style":308},[441],{"type":21,"value":442},"findOne",{"type":16,"tag":35,"props":444,"children":445},{"style":42},[446],{"type":21,"value":447},"())\n",{"type":16,"tag":35,"props":449,"children":451},{"class":37,"line":450},14,[452],{"type":16,"tag":35,"props":453,"children":454},{"emptyLinePlaceholder":230},[455],{"type":21,"value":233},{"type":16,"tag":35,"props":457,"children":459},{"class":37,"line":458},15,[460,465],{"type":16,"tag":35,"props":461,"children":462},{"style":308},[463],{"type":21,"value":464},"useHead",{"type":16,"tag":35,"props":466,"children":467},{"style":42},[468],{"type":21,"value":469},"({\n",{"type":16,"tag":35,"props":471,"children":473},{"class":37,"line":472},16,[474,480,485,490,494,499,503,508],{"type":16,"tag":35,"props":475,"children":477},{"style":476},"--shiki-default:#B8A965",[478],{"type":21,"value":479},"    title",{"type":16,"tag":35,"props":481,"children":482},{"style":42},[483],{"type":21,"value":484},": ",{"type":16,"tag":35,"props":486,"children":487},{"style":90},[488],{"type":21,"value":489},"data",{"type":16,"tag":35,"props":491,"children":492},{"style":42},[493],{"type":21,"value":382},{"type":16,"tag":35,"props":495,"children":496},{"style":90},[497],{"type":21,"value":498},"value",{"type":16,"tag":35,"props":500,"children":501},{"style":42},[502],{"type":21,"value":382},{"type":16,"tag":35,"props":504,"children":505},{"style":90},[506],{"type":21,"value":507},"title",{"type":16,"tag":35,"props":509,"children":510},{"style":42},[511],{"type":21,"value":512},",\n",{"type":16,"tag":35,"props":514,"children":516},{"class":37,"line":515},17,[517,522],{"type":16,"tag":35,"props":518,"children":519},{"style":476},[520],{"type":21,"value":521},"    meta",{"type":16,"tag":35,"props":523,"children":524},{"style":42},[525],{"type":21,"value":526},":[\n",{"type":16,"tag":35,"props":528,"children":530},{"class":37,"line":529},18,[531],{"type":16,"tag":35,"props":532,"children":533},{"style":42},[534],{"type":21,"value":535},"        {\n",{"type":16,"tag":35,"props":537,"children":539},{"class":37,"line":538},19,[540,545,549,554,559,563],{"type":16,"tag":35,"props":541,"children":542},{"style":476},[543],{"type":21,"value":544},"            hid",{"type":16,"tag":35,"props":546,"children":547},{"style":42},[548],{"type":21,"value":484},{"type":16,"tag":35,"props":550,"children":551},{"style":101},[552],{"type":21,"value":553},"'",{"type":16,"tag":35,"props":555,"children":556},{"style":107},[557],{"type":21,"value":558},"description",{"type":16,"tag":35,"props":560,"children":561},{"style":101},[562],{"type":21,"value":553},{"type":16,"tag":35,"props":564,"children":565},{"style":42},[566],{"type":21,"value":512},{"type":16,"tag":35,"props":568,"children":570},{"class":37,"line":569},20,[571,576,580,584,588,592],{"type":16,"tag":35,"props":572,"children":573},{"style":476},[574],{"type":21,"value":575},"            name",{"type":16,"tag":35,"props":577,"children":578},{"style":42},[579],{"type":21,"value":484},{"type":16,"tag":35,"props":581,"children":582},{"style":101},[583],{"type":21,"value":553},{"type":16,"tag":35,"props":585,"children":586},{"style":107},[587],{"type":21,"value":558},{"type":16,"tag":35,"props":589,"children":590},{"style":101},[591],{"type":21,"value":553},{"type":16,"tag":35,"props":593,"children":594},{"style":42},[595],{"type":21,"value":512},{"type":16,"tag":35,"props":597,"children":599},{"class":37,"line":598},21,[600,605,609,613,617,621,625,629],{"type":16,"tag":35,"props":601,"children":602},{"style":476},[603],{"type":21,"value":604},"            content",{"type":16,"tag":35,"props":606,"children":607},{"style":42},[608],{"type":21,"value":484},{"type":16,"tag":35,"props":610,"children":611},{"style":90},[612],{"type":21,"value":489},{"type":16,"tag":35,"props":614,"children":615},{"style":42},[616],{"type":21,"value":382},{"type":16,"tag":35,"props":618,"children":619},{"style":90},[620],{"type":21,"value":498},{"type":16,"tag":35,"props":622,"children":623},{"style":42},[624],{"type":21,"value":382},{"type":16,"tag":35,"props":626,"children":627},{"style":90},[628],{"type":21,"value":558},{"type":16,"tag":35,"props":630,"children":631},{"style":42},[632],{"type":21,"value":512},{"type":16,"tag":35,"props":634,"children":636},{"class":37,"line":635},22,[637],{"type":16,"tag":35,"props":638,"children":639},{"style":42},[640],{"type":21,"value":641},"          }\n",{"type":16,"tag":35,"props":643,"children":645},{"class":37,"line":644},23,[646],{"type":16,"tag":35,"props":647,"children":648},{"style":42},[649],{"type":21,"value":650},"    ]\n",{"type":16,"tag":35,"props":652,"children":654},{"class":37,"line":653},24,[655],{"type":16,"tag":35,"props":656,"children":657},{"style":42},[658],{"type":21,"value":659},"})\n",{"type":16,"tag":35,"props":661,"children":663},{"class":37,"line":662},25,[664],{"type":16,"tag":35,"props":665,"children":666},{"emptyLinePlaceholder":230},[667],{"type":21,"value":233},{"type":16,"tag":35,"props":669,"children":671},{"class":37,"line":670},26,[672,677,682,686],{"type":16,"tag":35,"props":673,"children":674},{"style":308},[675],{"type":21,"value":676},"onMounted",{"type":16,"tag":35,"props":678,"children":679},{"style":42},[680],{"type":21,"value":681},"(()",{"type":16,"tag":35,"props":683,"children":684},{"style":42},[685],{"type":21,"value":411},{"type":16,"tag":35,"props":687,"children":688},{"style":42},[689],{"type":21,"value":690}," {\n",{"type":16,"tag":35,"props":692,"children":694},{"class":37,"line":693},27,[695,700,704,709,713,717,721,725],{"type":16,"tag":35,"props":696,"children":697},{"style":90},[698],{"type":21,"value":699},"    console",{"type":16,"tag":35,"props":701,"children":702},{"style":42},[703],{"type":21,"value":382},{"type":16,"tag":35,"props":705,"children":706},{"style":308},[707],{"type":21,"value":708},"log",{"type":16,"tag":35,"props":710,"children":711},{"style":42},[712],{"type":21,"value":358},{"type":16,"tag":35,"props":714,"children":715},{"style":90},[716],{"type":21,"value":489},{"type":16,"tag":35,"props":718,"children":719},{"style":42},[720],{"type":21,"value":382},{"type":16,"tag":35,"props":722,"children":723},{"style":90},[724],{"type":21,"value":498},{"type":16,"tag":35,"props":726,"children":727},{"style":42},[728],{"type":21,"value":729},")\n",{"type":16,"tag":35,"props":731,"children":733},{"class":37,"line":732},28,[734,738,742,746,750,754,758,762],{"type":16,"tag":35,"props":735,"children":736},{"style":90},[737],{"type":21,"value":699},{"type":16,"tag":35,"props":739,"children":740},{"style":42},[741],{"type":21,"value":382},{"type":16,"tag":35,"props":743,"children":744},{"style":308},[745],{"type":21,"value":708},{"type":16,"tag":35,"props":747,"children":748},{"style":42},[749],{"type":21,"value":358},{"type":16,"tag":35,"props":751,"children":752},{"style":90},[753],{"type":21,"value":300},{"type":16,"tag":35,"props":755,"children":756},{"style":42},[757],{"type":21,"value":382},{"type":16,"tag":35,"props":759,"children":760},{"style":90},[761],{"type":21,"value":387},{"type":16,"tag":35,"props":763,"children":764},{"style":42},[765],{"type":21,"value":729},{"type":16,"tag":35,"props":767,"children":769},{"class":37,"line":768},29,[770],{"type":16,"tag":35,"props":771,"children":772},{"style":42},[773],{"type":21,"value":659},{"type":16,"tag":35,"props":775,"children":777},{"class":37,"line":776},30,[778],{"type":16,"tag":35,"props":779,"children":780},{"emptyLinePlaceholder":230},[781],{"type":21,"value":233},{"type":16,"tag":35,"props":783,"children":785},{"class":37,"line":784},31,[786,790,794],{"type":16,"tag":35,"props":787,"children":788},{"style":42},[789],{"type":21,"value":199},{"type":16,"tag":35,"props":791,"children":792},{"style":48},[793],{"type":21,"value":246},{"type":16,"tag":35,"props":795,"children":796},{"style":42},[797],{"type":21,"value":56},{"type":16,"tag":17,"props":799,"children":800},{},[801,803,809],{"type":21,"value":802},"So we already know some debugging functions in javascript like ",{"type":16,"tag":31,"props":804,"children":806},{"className":805},[],[807],{"type":21,"value":808},"console.log()",{"type":21,"value":810},"\nbut there is time they never help to such situation, that's when you find that the real  thing to use is",{"type":16,"tag":24,"props":812,"children":816},{"className":813,"code":814,"language":815,"meta":7,"style":7},"language-js shiki shiki-themes vitesse-dark","console.trace()\n","js",[817],{"type":16,"tag":31,"props":818,"children":819},{"__ignoreMap":7},[820],{"type":16,"tag":35,"props":821,"children":822},{"class":37,"line":38},[823,828,832,837],{"type":16,"tag":35,"props":824,"children":825},{"style":90},[826],{"type":21,"value":827},"console",{"type":16,"tag":35,"props":829,"children":830},{"style":42},[831],{"type":21,"value":382},{"type":16,"tag":35,"props":833,"children":834},{"style":308},[835],{"type":21,"value":836},"trace",{"type":16,"tag":35,"props":838,"children":839},{"style":42},[840],{"type":21,"value":316},{"type":16,"tag":17,"props":842,"children":843},{},[844,846,852,854],{"type":21,"value":845},"So here is the step by step of doing the things. I am using CodePen for writing these simple codes. Let us suppose we have two functions ",{"type":16,"tag":31,"props":847,"children":849},{"className":848},[],[850],{"type":21,"value":851},"add",{"type":21,"value":853}," and ",{"type":16,"tag":31,"props":855,"children":857},{"className":856},[],[858],{"type":21,"value":859},"consoleAdd",{"type":16,"tag":17,"props":861,"children":862},{},[863],{"type":16,"tag":864,"props":865,"children":868},"img",{"alt":866,"src":867},"Alt Text","https://dev-to-uploads.s3.amazonaws.com/i/wvl9xpa32be19fnbl48e.png",[],{"type":16,"tag":17,"props":870,"children":871},{},[872,874,880,882,888,890,895],{"type":21,"value":873},"And I think you have noticed that in ",{"type":16,"tag":31,"props":875,"children":877},{"className":876},[],[878],{"type":21,"value":879},"add()",{"type":21,"value":881}," function we have something called ",{"type":16,"tag":31,"props":883,"children":885},{"className":884},[],[886],{"type":21,"value":887},"console.trace()",{"type":21,"value":889}," so at this time we want to ensure and know where exactly ",{"type":16,"tag":31,"props":891,"children":893},{"className":892},[],[894],{"type":21,"value":879},{"type":21,"value":896}," function was called from.",{"type":16,"tag":17,"props":898,"children":899},{},[900,902,908],{"type":21,"value":901},"So to know this we will go in ",{"type":16,"tag":31,"props":903,"children":905},{"className":904},[],[906],{"type":21,"value":907},"console ",{"type":21,"value":909}," in browser dev tools, as where every console functions are found, so what you will see is the list of where the function is going called and there parents function\nbut the exact function will be the first one as you see right here",{"type":16,"tag":17,"props":911,"children":912},{},[913],{"type":16,"tag":864,"props":914,"children":916},{"alt":866,"src":915},"https://dev-to-uploads.s3.amazonaws.com/i/ls1z1xd8yxhhsouaa0z2.png",[],{"type":16,"tag":17,"props":918,"children":919},{},[920,922,927,929,934,936,941,943,948,950,955],{"type":21,"value":921},"It thinks you already see that we have ",{"type":16,"tag":31,"props":923,"children":925},{"className":924},[],[926],{"type":21,"value":851},{"type":21,"value":928}," in the first place so that's where our ",{"type":16,"tag":31,"props":930,"children":932},{"className":931},[],[933],{"type":21,"value":887},{"type":21,"value":935}," was called from , but remember our aim is not knowing where ",{"type":16,"tag":31,"props":937,"children":939},{"className":938},[],[940],{"type":21,"value":887},{"type":21,"value":942}," was called from but where ",{"type":16,"tag":31,"props":944,"children":946},{"className":945},[],[947],{"type":21,"value":879},{"type":21,"value":949}," was called from\nsimple console.trace() shows every function call from where ",{"type":16,"tag":31,"props":951,"children":953},{"className":952},[],[954],{"type":21,"value":887},{"type":21,"value":956}," is called to the last one\nI think you can see it clear in the above image that",{"type":16,"tag":958,"props":959,"children":960},"ol",{},[961,977,993],{"type":16,"tag":962,"props":963,"children":964},"li",{},[965,970,972],{"type":16,"tag":31,"props":966,"children":968},{"className":967},[],[969],{"type":21,"value":887},{"type":21,"value":971}," was called in ",{"type":16,"tag":31,"props":973,"children":975},{"className":974},[],[976],{"type":21,"value":879},{"type":16,"tag":962,"props":978,"children":979},{},[980,985,987],{"type":16,"tag":31,"props":981,"children":983},{"className":982},[],[984],{"type":21,"value":879},{"type":21,"value":986}," was called from ",{"type":16,"tag":31,"props":988,"children":990},{"className":989},[],[991],{"type":21,"value":992},"consoleAdd()",{"type":16,"tag":962,"props":994,"children":995},{},[996,998,1003,1005,1011],{"type":21,"value":997},"And finally ",{"type":16,"tag":31,"props":999,"children":1001},{"className":1000},[],[1002],{"type":21,"value":992},{"type":21,"value":1004}," was called by ",{"type":16,"tag":31,"props":1006,"children":1008},{"className":1007},[],[1009],{"type":21,"value":1010},"anonymous",{"type":21,"value":1012}," as it was called by browser while running the code.",{"type":16,"tag":1014,"props":1015,"children":1016},"blockquote",{},[1017],{"type":16,"tag":17,"props":1018,"children":1019},{},[1020,1022],{"type":21,"value":1021},"Simply those number on the end of the name of a function are the number of the line where the function is returned or if the function did not return anything they take the next line to the last function curry brace ",{"type":16,"tag":31,"props":1023,"children":1025},{"className":1024},[],[1026],{"type":21,"value":392},{"type":16,"tag":17,"props":1028,"children":1029},{},[1030,1032,1038,1040,1046],{"type":21,"value":1031},"That ",{"type":16,"tag":1033,"props":1034,"children":1035},"strong",{},[1036],{"type":21,"value":1037},"5",{"type":21,"value":1039}," you saw, is the output of ",{"type":16,"tag":31,"props":1041,"children":1043},{"className":1042},[],[1044],{"type":21,"value":1045},"add(2,3).",{"type":21,"value":1047},"I hope this post help, Thank you dev community",{"type":16,"tag":1049,"props":1050,"children":1051},"table",{},[1052,1076],{"type":16,"tag":1053,"props":1054,"children":1055},"thead",{},[1056],{"type":16,"tag":1057,"props":1058,"children":1059},"tr",{},[1060,1066,1071],{"type":16,"tag":1061,"props":1062,"children":1063},"th",{},[1064],{"type":21,"value":1065},"Key",{"type":16,"tag":1061,"props":1067,"children":1068},{},[1069],{"type":21,"value":1070},"Type",{"type":16,"tag":1061,"props":1072,"children":1073},{},[1074],{"type":21,"value":1075},"Description",{"type":16,"tag":1077,"props":1078,"children":1079},"tbody",{},[1080,1099,1116],{"type":16,"tag":1057,"props":1081,"children":1082},{},[1083,1089,1094],{"type":16,"tag":1084,"props":1085,"children":1086},"td",{},[1087],{"type":21,"value":1088},"1",{"type":16,"tag":1084,"props":1090,"children":1091},{},[1092],{"type":21,"value":1093},"Wonderful",{"type":16,"tag":1084,"props":1095,"children":1096},{},[1097],{"type":21,"value":1098},"Table",{"type":16,"tag":1057,"props":1100,"children":1101},{},[1102,1107,1111],{"type":16,"tag":1084,"props":1103,"children":1104},{},[1105],{"type":21,"value":1106},"2",{"type":16,"tag":1084,"props":1108,"children":1109},{},[1110],{"type":21,"value":1093},{"type":16,"tag":1084,"props":1112,"children":1113},{},[1114],{"type":21,"value":1115},"Data",{"type":16,"tag":1057,"props":1117,"children":1118},{},[1119,1124,1128],{"type":16,"tag":1084,"props":1120,"children":1121},{},[1122],{"type":21,"value":1123},"3",{"type":16,"tag":1084,"props":1125,"children":1126},{},[1127],{"type":21,"value":1093},{"type":16,"tag":1084,"props":1129,"children":1130},{},[1131],{"type":21,"value":1132},"Website",{"type":16,"tag":1134,"props":1135,"children":1137},"h2",{"id":1136},"references",[1138],{"type":21,"value":1139},"References",{"type":16,"tag":958,"props":1141,"children":1142},{},[1143],{"type":16,"tag":962,"props":1144,"children":1145},{},[1146],{"type":16,"tag":1147,"props":1148,"children":1152},"a",{"href":1149,"rel":1150},"https://developer.mozilla.org/en-US/",[1151],"nofollow",[1153],{"type":21,"value":1154},"Mozilla Developer Network MDN",{"type":16,"tag":1156,"props":1157,"children":1158},"style",{},[1159],{"type":21,"value":1160},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":7,"searchDepth":59,"depth":59,"links":1162},[1163],{"id":1136,"depth":59,"text":1139},"markdown","content:blog:trace-js-function.md","content","blog/trace-js-function.md","blog/trace-js-function","md",1792010498372]