What does the following output?
# what will the following code output?
const arr = [5, 9, 4, 12];
for (var i = 0; i < arr.length; i++) {
setTimeout(function() {
console.log('Index: ' + i + ', element: ' + arr[i]);
}, 3000);
What does the following output?
# what will the following code output?
const arr = [5, 9, 4, 12];
for (var i = 0; i < arr.length; i++) {
setTimeout(function() {
console.log('Index: ' + i + ', element: ' + arr[i]);
}, 3000);
| /* | |
| Borders | |
| - - - - - - - - - - - - - - - - - - - - - - - - - | |
| Helper classes for adding borders to elements | |
| Class names follow this convention: | |
| .[type][direction][size] |
| /* | |
| Spacing | |
| - - - - - - - - - - - - - - - - - - - - - - - - - | |
| Helper classes for spacing like margin and padding. | |
| Class names follow this convention: | |
| .[type][direction][size] |
| 'use strict'; | |
| const request = require('request'); | |
| module.exports = function forward(req, res, next) { | |
| var myRequest = request({ | |
| url: req.url, | |
| headers: req.headers | |
| }); | |
| req.pipe(myRequest) |
| const path = require('path') | |
| , Umzug = require('umzug') | |
| , Bluebird = require('bluebird') | |
| const db = { | |
| // sequelize instance | |
| sequelize: null, | |
| // Sequelize constructor | |
| Sequelize: null | |
| }; |
| #!groovy | |
| /** | |
| * Requires tool definitions for nodejs, jdk, maven, and ant | |
| * Requires config files .npmrc and maven-settings.xml | |
| */ | |
| node() { | |
| // checkout clean code | |
| stage("checkout") { | |
| checkout scm |
| #!groovy | |
| node() { | |
| // checkout clean code | |
| stage("checkout") { | |
| checkout scm | |
| sh "git clean -fdx" | |
| } | |
| stage("gitUrl" ) { |
| #!groovy | |
| step([$class: 'GitHubCommitStatusSetter', | |
| contextSource: [$class: 'ManuallyEnteredCommitContextSource', context: 'preflight-build'], | |
| statusResultSource: [$class: 'ConditionalStatusResultSource', | |
| results: [[$class: 'AnyBuildResult', message: 'Preflight build successful', state: 'SUCCESS']]]]) |
| import jenkins.model.* | |
| import hudson.model.* | |
| import jenkins.plugins.nodejs.tools.* | |
| import hudson.tools.* | |
| def inst = Jenkins.getInstance() | |
| def desc = inst.getDescriptor("jenkins.plugins.nodejs.tools.NodeJSInstallation") | |
| def versions = [ |