n queens in JavaScript