• Register
1 vote
19 views

Problem:

Hello Kodlogers,

I’ve completed the basic Java courses a few days ago and now focusing on web-based programming languages. I just started  JavaScript as my first preference. But the problem is I don’t know the attribute, function or method very well in JavaScript. Yeah! I know its foolish. Could you please shed some light on this?

Thanks for your help guys.

12 7 7
15,250 points

Please log in or register to answer this question.

1 Answer

1 vote

Solution:

Well, it is mandatory to read and follow the documentation carefully before starting a programming language. So, please check the Documentation before go ahead further.

If you want to check whether the string is empty/null/undefined, use the following code:

let emptyStr = "";
if (!emptyStr) {
  console.log("This String is empty");
}

let nullStr = null;
if (!nullStr) {
  console.log("This String is null");
}

 

13 9 6
94,240 points

Related questions

0 votes
1 answer 29 views
29 views
I am new to this. I just want to know how to do that?
asked Nov 17, 2020 TeamScript 13.5k points
0 votes
1 answer 6 views
6 views
Problem: How can I check if a string contains another substring in javascript?Generally I would expect a method String.contains(), but there doesn't seem to be one.
asked Feb 12 sasha 8.7k points
0 votes
1 answer 5 views
5 views
Problem: Given the line of code var value = $("#text").val(); and value = 9.61, I need to convert 9.61to 9:61. How can I use the JavaScript function substitute here?
asked Feb 14 sasha 8.7k points
0 votes
1 answer 8 views
8 views
Problem: How can I trim a string in javascript?
asked Feb 15 sasha 8.7k points
0 votes
1 answer 8 views
8 views
Problem: I am working with textboxes in Winforms. I want to make sure that the user enters something in the textbox else an error message should be printed on the screen. How can I achieve it?
asked Oct 24, 2020 Code Learner 5.8k points
0 votes
1 answer 9 views
9 views
I was working on that but I got into some problems.
asked Nov 3, 2020 TeamScript 13.5k points
0 votes
1 answer 7 views
7 views
Problem: For loading the first page I need to check if there is an image in image_arrayand load the last image, otherwise lock the preview buttons; prompt the user to press the new image button; create an empty array to put the images there: The problem is that image_arraythe ... : ?> <script type="text/javascript"> <?php echo "image_array = ".json_encode($images);?> </script> <?php endif; ?>
asked Oct 21, 2020 sasha 8.7k points
0 votes
1 answer 19 views
19 views
I am new to python programming.. I was trying to check if a string is empty or whitespace in a code : Mystr= "" Yourstr = " " print ("This string is empty : ", end = "") if(not Yourstr): print ("Yes") print ("This string is empty : ", end = "") if(not Mystr): print ("No") It&rsquo;s output is : This string is empty : This string is empty : No Its not giving me actual result what can I do now?
asked Mar 16, 2020 LizzyM 6.1k points
0 votes
1 answer 11 views
0 votes
1 answer 30 views
30 views
Problem: I just started learning programming from an UDEMY course but there are still some point which i an unclear about I want to ask method that how i can check that array is empty or doesnot exist what i need to do please tell me. The problem with me is I am not able to find the correct method to do it please guide step by step for this. Thanks in Advance.
asked Nov 10, 2020 Han Li 710 points