Top "Null-check" questions

A check to see that an object has been instantiated.

Is there a way to check for both `null` and `undefined`?

Since TypeScript is strongly-typed, simply using if () {} to check for null and undefined doesn't sound right. Does TypeScript have any …

typescript null-check
How to check if a variable is not null?

I know that below are the two ways in JavaScript to check whether a variable is not null, but I’…

javascript comparison null-check
JavaScript null check

I've come across the following code: function test(data) { if (data != null && data !== undefined) { // some code here } } I'm …

javascript null undefined null-check
Null or empty check for a string variable

if((isnull(@value,''))='') I want to know whether the above piece of code works in checking if the …

sql sql-server-2008 null null-check
Java Object Null Check for method

I need to create a null check in this formula for the books[i] and I am not entirely sure …

java null-check
Struts2, String null check

I'm trying to do a null check on a String but it won't work. <s:iterator value="matrix" var="…

jsp struts2 null-check
Java string null check by != null or !str.equals(null)?

What's the best way to check for not null values in java. String query ="abcd"; query != null vs !query.equals(…

java string null null-check
C#: How to perform a null-check on a dynamic object

How do I perform a null-check on a dynamic object? Pseudo code: public void Main() { dynamic dynamicObject = 33; if(true) { // Arbitrary …

c# dynamic null-check
How to write a generic isEmpty method which can check for null, empty?

I am writing a utility method which can check for empty and null string, or collection or an object or …

java performance string null-check
Java 8 optional add return result only if optional.isPresent

I have a piece of code where an interface has an Optional return method and some of the classes that …

java java-8 optional null-check