How to you validate null or empty value in JavaScript?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Sep 18, 2018

 

You can check a value for null or empty in javascript by using below code snippet

function isnotEmpty(foo){

	if(foo==null || foo===""){
		return false;

	}
	return true;
}

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Programming

    How to Crack HTML5 Interview Questions

    HTML5 is the latest and one of the most advanced standards of HTML. It is not a programming language actually but it is one of the most important components of modern day web application. This is used..

    Programming

    A set of Interview questions for HR Position

    In the ideal hierarchy of an organizational structure, HR plays a very important role. No one can simply rely upon a technical, Administration and other segments only. HR stands for Human Resource man..

    Programming

    Five tips to newly graduated Job seeker that are going to land on their first Job Interview

    Finding a job right after graduation is not always easy. There is usually tough competition from other graduates. Not only do you have to compete with other graduates from top schools, but you also ha...