I often see this pattern:
request( 'https://www.apple.com/macbook/', function( err, result ) {
if ( err ) return res.( 500 ).send( "Error" )
mac = new Macs({
mac: result
})
mac.save()
})
This suggests the if
statement can reliably execute before the mac.save()
. But trying this in other situations, I'm seeing thing happen before the if statement is considered (or the commands in it executed completely).
So is it blocking? While we're on it, is var
blocking?