Method in js that defines a variable and determines whether it is null

  • 2020-03-30 02:58:35
  • OfStack

Var params=null; Method to determine if params is not null:
 
if(params && params.hasOwnProperty("name")){} 

Among them: the console. The info (params); // result: Object {}

Related articles: