blogger1

    0

    1

    bilenray

    The code creates an array of three introductions, each containing a function that prints "Hello, Karl, my name is Friedrich, and Hello, Gauss, my name is Gauss.

    var introductions = [],
    
    names = ['Karl', 'Friedrich', 'Gauss'];
    
    for (var i = 0; i < 3; i++) { introductions[i] = (soAndSo) =>
    
    `Hello, ${soAndSo}, my name is ${names[i]}` }
    
    introductions
    
      //=> [ [Function],
    
      //     [Function],
    
      //     [Function] ]
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.