@Null (JavaScript)
Returns an empty string.
Defined in
@Functions (JavaScript)Syntax
@Null() : any
Return value | Description |
---|---|
any |
An empty string. |
Usage
This function returns an empty string. Do not confuse it with thenull
value.Examples
(1) This example includes@Null
in
a list and checks for it with @IsNull
.function p(stuff) {
print("<<<" + stuff + ">>>");
}
var cities = new Array("Paris", "Berlin", @Null(), "Moscow", "London");
for(var i = 0; i < cities.length; i++) {
if(!@IsNull(cities[i])) p(cities[i]);
}
(2) This example includes an empty string in a list
and checks for it with @IsNull
.
function p(stuff) {
print("<<<" + stuff + ">>>");
}
var cities = new Array("Paris", "Berlin", "", "Moscow", "London");
for(var i = 0; i < cities.length; i++) {
if(!@IsNull(cities[i])) p(cities[i]);
}
(3) This example includes @Null
in
a list and checks for it by comparing to an empty string.
function p(stuff) {
print("<<<" + stuff + ">>>");
}
var cities = new Array("Paris", "Berlin", @Null(), "Moscow", "London");
for(var i = 0; i < cities.length; i++) {
if(cities[i] != "") p(cities[i]);
}
(4) This example includes null
in
a list and checks for it by comparing to null
.
function p(stuff) {
print("<<<" + stuff + ">>>");
}
var cities = new Array("Paris", "Berlin", null, "Moscow", "London");
for(var i = 0; i < cities.length; i++) {
if(cities[i] != null) p(cities[i]);
}