add char in specific index stirng javascript

JavaScript
int j = 123456;
String x = Integer.toString(j);
x = x.substring(0, 4) + "." + x.substring(4, x.length);

//output : 1234.56
Source

Also in JavaScript: