M
M
Max Developer2017-10-03 15:50:51
JavaScript
Max Developer, 2017-10-03 15:50:51

Google tag manager error?

In google tag manager when inserting javascript code following their example

function()
{
var dSelector = '[name=your-sex]';
var dOptions = document.querySelectorAll(dSelector+' option');
for(var i = 0; i < dOptions.length; i++)
if(dOptions[i].selected)
return dOptions[i].innerHTML;
}

I get in response "Error on line 6, symbol 38. Parse error. ')' expected"
I can not understand what I did wrong (

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Victor L, 2019-06-25
@nickname13384

const dataParse = (string) => {
  let options = {
    day: '2-digit',
    month: 'short',
    year: 'numeric',
    weekday: 'short',
    timezone: 'UTC' 
  }
  let data = new Date(string).toLocaleString("ru", options).split(",")
  return `${data[1]},${data[0]}`
}

console.log(dataParse('12.05.18'))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question