What does "type" mean and is there is a special use for a question mark in ECMA 6?

delete

In React Native Example Code, you'll find at some files the type statement, which encapsulates 4 properties (I'd like to guess), where the last two ones are suffixed with question marks.

type MapRegion = {
  latitude: number,
  longitude: number,
  latitudeDelta?: number,
               ^============   What are these...
  longitudeDelta?: number,
};              ^===========...question marks for? 

What does all this mean? In specification of ECMAScript 6 I can't find anything regarding "type".

Juan Mendes

That is flow, a transpiler language that adds static typing to JavaScript.

type MapRegion = {
  latitude: number,
  longitude: number,
  // This property is nullable
  latitudeDelta?: number,
  // This property is nullable
  longitudeDelta?: number,
}; 

// The following does not cause a compilation error

/* @flow */
var a:MapRegion = {
  latitude: 1,
  longitude: 3 
};

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What does question mark mean?

From Dev

What does the question mark mean in a type parameter bound?

From Dev

What does question mark equals mean in CoffeeScript?

From Dev

What does this question mark mean in Flow: "?() => void"

From Dev

What does the question mark in "Decimal?" mean?

From Dev

XML what does that question mark mean

From Dev

What does the triple question mark mean in scala?

From Dev

What does the question mark in java mean?

From Dev

What does .php question mark = mean?

From Dev

What does the question mark in terminal command mean?

From Dev

What does the "?" (question mark) mean in javascript?

From Dev

What does this two question mark mean?

From Dev

What does the question mark in terminal command mean?

From Dev

What does hypothesis with operator with question mark mean

From Java

What does double question mark (??) operator mean in PHP

From Java

What does question mark and dot operator ?. mean in C# 6.0?

From Dev

What does the question mark in member access mean in C#?

From Dev

What does the question mark icon by a file name mean in Aptana?

From Dev

ES6 imports - what does the exclamation mark mean?

From Dev

What does %-mark mean in Clojure?

From Dev

What do a question mark (?) and an ampersand (&) mean in a URL?

From Dev

What does a question mark after the file name mean using ls terminal command?

From Java

What does an exclamation mark mean in the Swift language?

From Dev

What does the exclamation mark mean for a swift initializer?

From Dev

What does this exclamation mark mean in Javascript?

From Dev

What does an exclamation mark mean in diff output?

From Dev

What does the exclamation mark mean in udev rule?

From Dev

What is the point of the 'Symbol' type in ECMA-262-v6?

From Dev

What does "Illegal use of type 'void' in signature" mean?

Related Related

  1. 1

    What does question mark mean?

  2. 2

    What does the question mark mean in a type parameter bound?

  3. 3

    What does question mark equals mean in CoffeeScript?

  4. 4

    What does this question mark mean in Flow: "?() => void"

  5. 5

    What does the question mark in "Decimal?" mean?

  6. 6

    XML what does that question mark mean

  7. 7

    What does the triple question mark mean in scala?

  8. 8

    What does the question mark in java mean?

  9. 9

    What does .php question mark = mean?

  10. 10

    What does the question mark in terminal command mean?

  11. 11

    What does the "?" (question mark) mean in javascript?

  12. 12

    What does this two question mark mean?

  13. 13

    What does the question mark in terminal command mean?

  14. 14

    What does hypothesis with operator with question mark mean

  15. 15

    What does double question mark (??) operator mean in PHP

  16. 16

    What does question mark and dot operator ?. mean in C# 6.0?

  17. 17

    What does the question mark in member access mean in C#?

  18. 18

    What does the question mark icon by a file name mean in Aptana?

  19. 19

    ES6 imports - what does the exclamation mark mean?

  20. 20

    What does %-mark mean in Clojure?

  21. 21

    What do a question mark (?) and an ampersand (&) mean in a URL?

  22. 22

    What does a question mark after the file name mean using ls terminal command?

  23. 23

    What does an exclamation mark mean in the Swift language?

  24. 24

    What does the exclamation mark mean for a swift initializer?

  25. 25

    What does this exclamation mark mean in Javascript?

  26. 26

    What does an exclamation mark mean in diff output?

  27. 27

    What does the exclamation mark mean in udev rule?

  28. 28

    What is the point of the 'Symbol' type in ECMA-262-v6?

  29. 29

    What does "Illegal use of type 'void' in signature" mean?

HotTag

Archive