@bookercodes
@bookercodes
@bookercodes
Flow is A STATIC TYPE CHECKER FOR JAVASCRIPT
@bookercodes
Flow is A STATIC TYPE CHECKER FOR JAVASCRIPT
Flow is A Javascript productivity tool
@bookercodes
function area (r) {
return Math.PI * r * r
}
const result = area("1O")
// @flow
❌ ^^^^ This type is incompatible with number.
@bookercodes
function length (value) {
return value.length
}
const result = length(null)
// @flow
@bookercodes
❌ ^^^^^^ property cannot be accessed on potentially null value
function length (value) {
if (value != null) {
return value.length
}
return 0
}
const result = length(null)
// @flow
@bookercodes
function length (value) {
if (value != null) {
return value.length
}
return 0
}
module.exports = length
// @flow
@bookercodes
function length (value: string): number {
if (value != null) {
return value.length
}
return 0
}
module.exports = length
// @flow
@bookercodes
@bookercodes
@bookercodes
const num: number = 10
@bookercodes
const num = 10
@bookercodes