A
A
AskJs2018-03-22 13:51:55
JavaScript
AskJs, 2018-03-22 13:51:55

How to refer to an object inside a function?

How to set new value for c0?

export const newTest= function (a, b, c) {
    var test= [{}];

    if (c) {
        c.forEach(function (a, b, c) {
            test.push({
               a0: 5,
               b0: b,
               c0: c
            });
        });
    }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2018-03-22
@satellite

This is impossible, because closure(scope) will not allow. And there are no access methods from outside to the test variable .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question