Created
October 25, 2019 09:33
-
-
Save Zmetser/2d231e8c4bd926c33ebf1e5be8b69557 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @flow */ | |
type Slide = {| id: number |} | |
class Test { | |
slidesWithAds: Array<Slide> = [{id: 2}, {id: 4}]; | |
getNonAdSlideIndex(indexWithAds: number): ?Slide { | |
return this.slidesWithAds[indexWithAds]; | |
} | |
} | |
const test = new Test(); | |
const slide = test.getNonAdSlideIndex(4); | |
slide.id // < Cannot get `slide.id` because property `id` is missing in null or undefined [1]. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment