Good afternoon, there is a condition in the code:
if (typeof sbjs.get.current.typ !== "undefined") { var type_traffic = sbjs.get.current.typ; } else { var type_traffic = null; } it is necessary to replace this condition with a more compact entry
Good afternoon, there is a condition in the code:
if (typeof sbjs.get.current.typ !== "undefined") { var type_traffic = sbjs.get.current.typ; } else { var type_traffic = null; } it is necessary to replace this condition with a more compact entry
Use design? :
var type_traffic = (typeof sbjs.get.current.typ !== "undefined") ? sbjs.get.current.typ : null; And never declare variables inside loops / conditions. In your case, you had to declare the variable before if.
var type_traffic; if (typeof sbjs.get.current.typ !== "undefined") { type_traffic = sbjs.get.current.typ; } else { type_traffic = null; } var declared with var - GrundySource: https://ru.stackoverflow.com/questions/525994/
All Articles