Closed1

ぬるぽ一覧表

黒ヰ樹黒ヰ樹
const s = null;
const length = s.length; // TypeError: Cannot read property 'length' of null
const s: string | null = null;
const length = s.length; // error TS18047: 's' is possibly 'null'.
s = None
length = len(s) # TypeError: object of type 'NoneType' has no len()
$s = null;
$length = strlen($s); // Warning: strlen() expects parameter 1 to be string, null given
s = nil
length = s.length # NoMethodError: undefined method `length' for nil:NilClass
var s *string = nil
length := len(*s) // panic: runtime error: invalid memory address or nil pointer dereference
String s = null;
int length = s.length(); // java.lang.NullPointerException
val s: String? = null
val length = s.length // NullPointerException
val s: String = null
val length = s.length // java.lang.NullPointerException
string s = null;
int length = s.Length; // NullReferenceException
let s: Option<&str> = None;
let length = s.unwrap().len(); // thread 'main' panicked at 'called `Option::unwrap()` on a `None` value'
このスクラップは22日前にクローズされました