Doubt about the default value of ES6 function parameters

clipboard.png

Why do I get an error when I use var outside? You won"t make a mistake in it?

function fn(x=8){
  var x = 89;
  console.log(x);//
}
fn();
let y = 7;
var y = 8;//
Apr.25,2021
The parameters of the

function are equivalent to the variables from var. The repeated definition of var will not report an error


because on the outside
you declare y
you declare y
if you declare y with var


let/const forbids variable promotion

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eabb87-207a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eabb87-207a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?