Really Javascript has no block-level scopes?

yes, JavaScript has no block-level scopes.

        if (true) { 

           var color = "blue"; 

        } 

        document.writeln(color); //"blue" 

        

        for (var i = 0; i < 10; i++){ 

           document.writeln(i); 

        } 

        document.writeln(i); //10