Skip to content

How to use variables and functions that were previously announced #25

@saper639

Description

@saper639

Hello! Explain how to use variables and functions that were previously announced.
Example:
function test() {
return 1;
}
var foo = 5;
var myData = new Parser()
.string('type', {length: 1, formatter: function(arr) {
console.log(foo);
console.log(test());
return arr;
}});
var buf = new Buffer('2D035958501', 'hex');
console.log(myData.parse(buf));

RefferenceError: foo is not defined
RefferenceError: test is not defined

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions