Write a JavaScript function to check whether a string is blank or not.Test Data :console.log(is_Blank(''));console.log(is_Blank('abc'));truefalse

Question

Write a JavaScript function to check whether a string is blank or not.Test Data :console.log(is_Blank(''));console.log(is_Blank('abc'));truefalse
🧐 Not the exact question you are looking for?Go ask a question

Solution 1

Sure, here is a simple JavaScript function that checks whether a string is blank or not:

function is_Blank(input) {
    if (input.length === 0)
        return true;
    else
        return false;
}

console.log(is_Blank(''));  // This will return true
console.log(is_Blank('abc'));  //
    Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study prob
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solv

This problem has been solved

Similar Questions

Write a JavaScript function to check whether a string is blank or not.Test Data :console.log(is_Blank(''));console.log(is_Blank('abc'));truefalse

Write a Java program to check whether a substring(abc) appears before a period(.) within a given string

What will the below statements print on the console?"use strict"function abc() {console.log(this);}abc();

What will the following JavaScript code output?(function() { var a = b = 5;})();console.log(b);5ReferenceError: b is not definednullundefined

Which of these method of class String is used to check whether a given object starts with a particular string literal?

1/3