<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script> let a = ''; if (!a && typeof a == 'object') { alert('是个null'); } else if (!a && typeof a == 'undefined') { alert('是个undefined'); } else if (!a && typeof a == 'string') { alert('是个空字符串'); } else { alert('其他'); } </script> </head> <body> </body> </html>