필드 · Maybe

필드 · Maybe · helpers.maybe. 생성 메서드 · 예시

helpers.maybe

생성 설정

데이터를 생성하면 결과가 표시됩니다.

매개변수 & 예시

Returns the result of the callback if the probability check was successful, otherwise undefined.

helpers.maybe(callback: () => TResult, options?: { probability? })
callback
The callback that will be invoked if the probability check was successful.
options
The options to use.
options.probability
The probability ([0.00, 1.00]) of the callback being invoked. Defaults to 0.5.

예시

null

테스트 환경에서 합성 데이터를 사용하세요.

관련 생성기

시나리오 탐색