javascript - Node sequelize callback promises expect a function, is there a method for removing declared function with a function call -


i'm having issue node sequelize library. when using success promise shown below:

for (index = 0; index < models.length; index++) {      model = models[index];      model.drop().success(function() {          droptablecompletecheck();      }); } 

jshint complains , rightly highlights code issue "don't make functions within loop". overcome issue i've tried replacing above code following:

for (index = 0; index < models.length; index++) {     model = models[index];     model.drop().success(droptablecompletecheck()); } 

this removes jshint issue, node sequelize throwing following uncaught exception:

error: uncaught application error:     typeerror: listener must function 

i'm trying call function on success promise callback, , remove jshint issue @ same time. there way of doing both, i'd happy pointers.

thanks time.

omit parentheses:

for (index = 0; index < models.length; index++) {     model = models[index];     //don't _invoke_ droptablecompletecheck, _reference_     model.drop().success(droptablecompletecheck); } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -