SOURCE

function getUrlParam(name){
  const reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)')
  const result = window.location.search.substr(1).match(reg)
  return result ? decodeURIComponent(result[2]) : null
}
console 命令行工具 X clear

                    
>
console