Working js structure in console