toInt method

int toInt([
  1. int def = 0
])

Converts a JavaScript value to a Dart integer.

Returns def when the value cannot be interpreted as an integer.

Implementation

int toInt([int def = 0]) => toNullableInt() ?? def;