0

I'm trying to understand why sometimes, in javascript using the console.log() command, a letter t appears before the praise displaying an object and sometimes not.

Question mays seem silly but I've been unable to find an answer so far.

To be more specific, I've been facing this issue trying to solve some GDPR issues using the tcfapi, but I guess it's a more global thing I've to understand.

So, what's the difference when on two different codes I use following command:

__tcfapi('getTCData',2,function(e){console.log(e)})

And I get in the beginning of the the displayed response either : t {x:1,y:2,z:3 etc

Or :  {x:1,y:2,z:3 etc (without the t at the start).

Thanks !

Barmar
  • 741,623
  • 53
  • 500
  • 612
JCDB
  • 135
  • 8
  • 2
    Typically means that the object is an instance of a class named `t`. See e.g https://stackoverflow.com/q/46224179/1048572 or https://stackoverflow.com/q/25141170/1048572 – Bergi Apr 08 '21 at 21:14
  • Waow thanks it makes sense ! I did not simply thought about that because I saw the same letter t testing on different websites. Is that possible that by any odds they choose the same class name ? I've tried eg on lemonde.fr or lefigaro.fr and noticed the same t, that's why I thought it had a more global meaning – JCDB Apr 08 '21 at 21:42
  • 1
    If both use the same fcfapi, it might be the same script and the same class? But even if not, single-letter identifiers are frequently chosen by minifiers (`t` is not the actual class name in the source code), there aren't that many to choose from. – Bergi Apr 08 '21 at 22:57

0 Answers0