How can I handle two one async.each into async.waterfall....Cannot read property 'bodyClass' of undefined

NodeBB Plugins
  • I have this code:

    var array=[];
    			function(called) {
                  var array=[];
              //Suppose to have another array that have some values called total
                       array= array.concat(item);
    //but i Obtain this error Cannot read property 'bodyClass' of undefined
    If there are some syntax error doesn't matter. Anyone can help me?
  • I have no idea where bodyClass comes into play, but maybe this will help:

    var async = require('async');
    var total = ['a', 'b'];
    async.waterfall([function(called) {
    	var arr = [1, 2];
    	async.forEach(total, function(item, callback) {
    		arr = arr.concat(item);
    	}, function(error) {
    		called(null, arr);
    }], function(err, elem) {
    	console.log(err, elem);
    	// Output: null [ 1, 2, 'a', 'b' ]
  • Is this for a hook of some sort? Please paste the entire function, and which hook you're subscribing to...

  • This post is deleted!

Suggested Topics

| | | |