词法范围示例不起作用

时间:2016-10-22 11:38:05

标签: javascript closures lexical-scope lexical-closures

为什么关闭不起作用?

  var derivedKey;
  lightwallet.keystore.deriveKeyFromPassword(password, function (err, pwDerivedKey) {
    derivedKey = pwDerivedKey;
  });

  if (!derivedKey){
    console.error ("ERROR no derivedKey");
  }

错误。有什么可能的解释?

0 个答案:

没有答案