This mechanism allows GPT to reduce perceived latency by fetching the JavaScript asynchronously while allowing the browser to continue rendering the page. The script then replaces cmd with a CommandArray object whose push method is defined to execute the function argument passed to it. When the GPT JavaScript is loaded, it looks through the array and executes all the functions in order. The googletag.cmd variable is initialized to an empty JavaScript array by the GPT tag syntax on the page, and cmd.push is the standard Array.push method that adds an element to the end of the array. Reference to the global command queue for asynchronous execution of GPT-related calls. Rest parameters accept an unbounded number of values of the This syntax is used for parameters and properties. Indicates that param is optional, but accepts either a number or a string This syntax is usedįor variables, parameters, properties, and return types. Indicates that param accepts or returns a string value. The following table shows examples of type annotations you may see in Type annotations describe the types the element to the left of the colonĬan accept or return. To learn more about supported types and type expressions, refer to theĪ colon after a variable, parameter name, property name, or function signature denotes a The following table provides aĪn array type, where values may only be strings.Ī union type, where the value may be either a number or a string.Īn array type, where values are a complex (union) type.Ī tuple type, where the value is a two-element array that must contain a number and a string in that order.Īn object type, where the value is an instance of googletag.Slot.Ī function type with no defined arguments and no return value. This reference uses TypeScript notation to describe types.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |