b was defined in braces, so console.log(b) fails outside.

#javascript #python #scope