DEV Community

Discussion on: Golang for JavaScript developers - Part 1

Collapse
 
nmhillusion profile image
nmhillusion

in golang,
after if block, variable val continues existing? Or it just exists in the if block?

Thread Thread
 
vinceramces profile image
Vince Ramces Oliveros

val is no longer accessible after the if statement. the variable is scoped to the if block