Create new
Bindings
Transitions
Animations
Easing
Component composition
Context API
Special elements
Module context
Debugging
Miscellaneous
App.svelte
runes
This component is not in runes mode.
To enable runes mode, either start using runes in your code, or add the following to the top of your component:
<svelte:options runes />
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
⌄
⌄
⌄
<script>
import { onMount } from 'svelte';
let distance = null;
async function getLocation() {
const response = await fetch('https://ipinfo.io/json');
const data = await response.json();
const lat1 = data.loc.split(',')[0];
const lon1 = data.loc.split(',')[1];
const lat2 = 39.57; // Mallorca latitude
const lon2 = 2.65; // Mallorca longitude
const R = 6371; // Earth's radius in KM
const dLat = (lat2 - lat1) * Math.PI / 180;
const dLon = (lon2 - lon1) * Math.PI / 180;
const a =
Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
Math.sin(dLon / 2) * Math.sin(dLon / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
distance = R * c;
}
onMount(() => {
getLocation();
});
</script>
<main class="bg-gray-200 min-h-screen p-8">
<h1 class="text-4xl font-bold mb-4">Afstand til Mallorca, Spanien</h1>
99
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
›
⌄
⌄
import 'svelte/internal/disclose-version';
import 'svelte/internal/flags/legacy';
import * as $ from 'svelte/internal/client';
import { onMount } from 'svelte';
var root_1 = $.template(
`<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css"> <style>html, body {
margin: 0;
padding: 0;
}</style>`,
1
);
var root_2 = $.template(`<p class="text-2xl font-semibold mb-4"> </p>`);
var root_3 = $.template(`<button class="px-4 py-2 bg-blue-500 text-white rounded shadow hover:bg-blue-700 transition-colors">Find min placering</button>`);
var root = $.template(`<main class="bg-gray-200 min-h-screen p-8"><h1 class="text-4xl font-bold mb-4">Afstand til Mallorca, Spanien</h1> <!></main>`);
export default function App($$anchor, $$props) {
$.push($$props, false);
let distance = $.mutable_state(null);
async function getLocation() {
const response = await fetch('https://ipinfo.io/json');
const data = await response.json();
const lat1 = data.loc.split(',')[0];
const lon1 = data.loc.split(',')[1];
const lat2 = 39.57; // Mallorca latitude
const lon2 = 2.65; // Mallorca longitude
const R = 6371; // Earth's radius in KM
const dLat = (lat2 - lat1) * Math.PI / 180;
const dLon = (lon2 - lon1) * Math.PI / 180;
const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * Math.sin(dLon / 2) * Math.sin(dLon / 2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
$.set(distance, R * c);
result = svelte.compile(source, {
generate: ,
});9
1
›
/* Add a <style> tag to see the CSS output */
Root {
- css: null
- js: []
- start: 810
- end: 1446
- type: "Root"
fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (4)
Text {...}
- type: "Text"
- start: 808
- end: 810
- raw: "\n\n"
- data: "\n\n"
} RegularElement {...}
- type: "RegularElement"
- start: 810
- end: 1254
- name: "main"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: 816
- end: 852
- name: "class"
value: [...] (1)
Text {...}
- start: 823
- end: 851
- type: "Text"
- raw: "bg-gray-200 min-h-screen p-8"
- data: "bg-gray-200 min-h-screen p-8"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (5)
Text {...}
- type: "Text"
- start: 853
- end: 855
- raw: "\n\t"
- data: "\n\t"
} RegularElement {...}
- type: "RegularElement"
- start: 855
- end: 925
- name: "h1"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: 859
- end: 890
- name: "class"
value: [...] (1)
Text {...}
- start: 866
- end: 889
- type: "Text"
- raw: "text-4xl font-bold mb-4"
- data: "text-4xl font-bold mb-4"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (1)
Text {...}
- type: "Text"
- start: 891
- end: 920
- raw: "Afstand til Mallorca, Spanien"
- data: "Afstand til Mallorca, Spanien"
}
]
}
} Text {...}
- type: "Text"
- start: 925
- end: 928
- raw: " "
- data: " "
} IfBlock {...}
- type: "IfBlock"
- elseif: false
- start: 928
- end: 1246
test: BinaryExpression {...}
- type: "BinaryExpression"
- start: 933
- end: 950
loc: {...}
start: {...}
- line: 38
- column: 6
}end: {...}
- line: 38
- column: 23
}
}left: Identifier {...}
- type: "Identifier"
- start: 933
- end: 941
loc: {...}
start: {...}
- line: 38
- column: 6
}end: {...}
- line: 38
- column: 14
}
}- name: "distance"
}- operator: "!=="
right: Literal {...}
- type: "Literal"
- start: 946
- end: 950
loc: {...}
start: {...}
- line: 38
- column: 19
}end: {...}
- line: 38
- column: 23
}
}- value: null
- raw: "null"
}
}consequent: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 951
- end: 953
- raw: "\n\t"
- data: "\n\t"
} RegularElement {...}
- type: "RegularElement"
- start: 953
- end: 1073
- name: "p"
attributes: [...] (1)
Attribute {...}
- type: "Attribute"
- start: 956
- end: 991
- name: "class"
value: [...] (1)
Text {...}
- start: 963
- end: 990
- type: "Text"
- raw: "text-2xl font-semibold mb-4"
- data: "text-2xl font-semibold mb-4"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 992
- end: 1016
- raw: "Du er i øjeblikket ≈ "
- data: "Du er i øjeblikket ≈ "
} ExpressionTag {...}
- type: "ExpressionTag"
- start: 1016
- end: 1037
expression: CallExpression {...}
- type: "CallExpression"
- start: 1017
- end: 1036
loc: {...}
start: {...}
- line: 40
- column: 24
}end: {...}
- line: 40
- column: 43
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 1017
- end: 1033
loc: {...}
start: {...}
- line: 40
- column: 24
}end: {...}
- line: 40
- column: 40
}
}object: Identifier {...}
- type: "Identifier"
- start: 1017
- end: 1025
loc: {...}
start: {...}
- line: 40
- column: 24
}end: {...}
- line: 40
- column: 32
}
}- name: "distance"
}property: Identifier {...}
- type: "Identifier"
- start: 1026
- end: 1033
loc: {...}
start: {...}
- line: 40
- column: 33
}end: {...}
- line: 40
- column: 40
}
}- name: "toFixed"
}- computed: false
- optional: false
}arguments: [...] (1)
Literal {...}
- type: "Literal"
- start: 1034
- end: 1035
loc: {...}
start: {...}
- line: 40
- column: 41
}end: {...}
- line: 40
- column: 42
}
}- value: 2
- raw: "2"
}
]- optional: false
}
} Text {...}
- type: "Text"
- start: 1037
- end: 1069
- raw: " KM væk fra Mallorca, Spanien."
- data: " KM væk fra Mallorca, Spanien."
}
]
}
} Text {...}
- type: "Text"
- start: 1073
- end: 1075
- raw: "\n\t"
- data: "\n\t"
}
]
}alternate: Fragment {...}
- type: "Fragment"
nodes: [...] (3)
Text {...}
- type: "Text"
- start: 1082
- end: 1084
- raw: "\n\t"
- data: "\n\t"
} RegularElement {...}
- type: "RegularElement"
- start: 1084
- end: 1239
- name: "button"
attributes: [...] (2)
Attribute {...}
- type: "Attribute"
- start: 1092
- end: 1183
- name: "class"
value: [...] (1)
Text {...}
- start: 1099
- end: 1182
- type: "Text"
- raw: "px-4 py-2 bg-blue-500 text-white rounded shadow hover:bg-blue-700 transition-colors"
- data: "px-4 py-2 bg-blue-500 text-white rounded shadow hover:bg-blue-700 transition-colors"
}
]
} OnDirective {...}
- start: 1184
- end: 1206
- type: "OnDirective"
- name: "click"
expression: Identifier {...}
- type: "Identifier"
- start: 1194
- end: 1205
loc: {...}
start: {...}
- line: 43
- column: 111
}end: {...}
- line: 43
- column: 122
}
}- name: "getLocation"
}- modifiers: []
}
]fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (1)
Text {...}
- type: "Text"
- start: 1207
- end: 1230
- raw: "Find min placering"
- data: "Find min placering"
}
]
}
} Text {...}
- type: "Text"
- start: 1239
- end: 1241
- raw: "\n\t"
- data: "\n\t"
}
]
}
} Text {...}
- type: "Text"
- start: 1246
- end: 1247
- raw: "\n"
- data: "\n"
}
]
}
} Text {...}
- type: "Text"
- start: 1254
- end: 1256
- raw: "\n\n"
- data: "\n\n"
} SvelteHead {...}
- type: "SvelteHead"
- start: 1256
- end: 1446
- name: "svelte:head"
- attributes: []
fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (5)
Text {...}
- type: "Text"
- start: 1269
- end: 1271
- raw: "\n\t"
- data: "\n\t"
} RegularElement {...}
- type: "RegularElement"
- start: 1271
- end: 1364
- name: "link"
attributes: [...] (2)
Attribute {...}
- type: "Attribute"
- start: 1277
- end: 1293
- name: "rel"
value: [...] (1)
Text {...}
- start: 1282
- end: 1292
- type: "Text"
- raw: "stylesheet"
- data: "stylesheet"
}
]
} Attribute {...}
- type: "Attribute"
- start: 1294
- end: 1363
- name: "href"
value: [...] (1)
Text {...}
- start: 1300
- end: 1362
- type: "Text"
- raw: "https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css"
- data: "https://cdn.jsdelivr.net/npm/tailwindcss/dist/tailwind.min.css"
}
]
}
]fragment: Fragment {...}
- type: "Fragment"
- nodes: []
}
} Text {...}
- type: "Text"
- start: 1364
- end: 1366
- raw: " "
- data: " "
} RegularElement {...}
- type: "RegularElement"
- start: 1366
- end: 1431
- name: "style"
- attributes: []
fragment: Fragment {...}
- type: "Fragment"
nodes: [...] (1)
Text {...}
- start: 1373
- end: 1423
- type: "Text"
- data: "html, body {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}"
- raw: "html, body {\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}"
}
]
}
} Text {...}
- type: "Text"
- start: 1431
- end: 1432
- raw: "\n"
- data: "\n"
}
]
}
}
]
}- options: null
instance: Script {...}
- type: "Script"
- start: 0
- end: 808
- context: "default"
content: Program {...}
- type: "Program"
- start: 8
- end: 799
loc: {...}
start: {...}
- line: 1
- column: 0
}end: {...}
- line: 33
- column: 0
}
}body: [...] (4)
ImportDeclaration {...}
- type: "ImportDeclaration"
- start: 10
- end: 43
loc: {...}
start: {...}
- line: 2
- column: 1
}end: {...}
- line: 2
- column: 34
}
}specifiers: [...] (1)
ImportSpecifier {...}
- type: "ImportSpecifier"
- start: 19
- end: 26
loc: {...}
start: {...}
- line: 2
- column: 10
}end: {...}
- line: 2
- column: 17
}
}imported: Identifier {...}
- type: "Identifier"
- start: 19
- end: 26
loc: {...}
start: {...}
- line: 2
- column: 10
}end: {...}
- line: 2
- column: 17
}
}- name: "onMount"
}local: Identifier {...}
- type: "Identifier"
- start: 19
- end: 26
loc: {...}
start: {...}
- line: 2
- column: 10
}end: {...}
- line: 2
- column: 17
}
}- name: "onMount"
}
}
]source: Literal {...}
- type: "Literal"
- start: 34
- end: 42
loc: {...}
start: {...}
- line: 2
- column: 25
}end: {...}
- line: 2
- column: 33
}
}- value: "svelte"
- raw: "'svelte'"
}
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 46
- end: 66
loc: {...}
start: {...}
- line: 4
- column: 1
}end: {...}
- line: 4
- column: 21
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 50
- end: 65
loc: {...}
start: {...}
- line: 4
- column: 5
}end: {...}
- line: 4
- column: 20
}
}id: Identifier {...}
- type: "Identifier"
- start: 50
- end: 58
loc: {...}
start: {...}
- line: 4
- column: 5
}end: {...}
- line: 4
- column: 13
}
}- name: "distance"
}init: Literal {...}
- type: "Literal"
- start: 61
- end: 65
loc: {...}
start: {...}
- line: 4
- column: 16
}end: {...}
- line: 4
- column: 20
}
}- value: null
- raw: "null"
}
}
]- kind: "let"
} FunctionDeclaration {...}
- type: "FunctionDeclaration"
- start: 69
- end: 758
loc: {...}
start: {...}
- line: 6
- column: 1
}end: {...}
- line: 28
- column: 2
}
}id: Identifier {...}
- type: "Identifier"
- start: 84
- end: 95
loc: {...}
start: {...}
- line: 6
- column: 16
}end: {...}
- line: 6
- column: 27
}
}- name: "getLocation"
}- expression: false
- generator: false
- async: true
- params: []
body: BlockStatement {...}
- type: "BlockStatement"
- start: 98
- end: 758
loc: {...}
start: {...}
- line: 6
- column: 30
}end: {...}
- line: 28
- column: 2
}
}body: [...] (12)
VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 102
- end: 157
loc: {...}
start: {...}
- line: 7
- column: 2
}end: {...}
- line: 7
- column: 57
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 108
- end: 156
loc: {...}
start: {...}
- line: 7
- column: 8
}end: {...}
- line: 7
- column: 56
}
}id: Identifier {...}
- type: "Identifier"
- start: 108
- end: 116
loc: {...}
start: {...}
- line: 7
- column: 8
}end: {...}
- line: 7
- column: 16
}
}- name: "response"
}init: AwaitExpression {...}
- type: "AwaitExpression"
- start: 119
- end: 156
loc: {...}
start: {...}
- line: 7
- column: 19
}end: {...}
- line: 7
- column: 56
}
}argument: CallExpression {...}
- type: "CallExpression"
- start: 125
- end: 156
loc: {...}
start: {...}
- line: 7
- column: 25
}end: {...}
- line: 7
- column: 56
}
}callee: Identifier {...}
- type: "Identifier"
- start: 125
- end: 130
loc: {...}
start: {...}
- line: 7
- column: 25
}end: {...}
- line: 7
- column: 30
}
}- name: "fetch"
}arguments: [...] (1)
Literal {...}
- type: "Literal"
- start: 131
- end: 155
loc: {...}
start: {...}
- line: 7
- column: 31
}end: {...}
- line: 7
- column: 55
}
}- value: "https://ipinfo.io/json"
- raw: "'https://ipinfo.io/json'"
}
]- optional: false
}
}
}
]- kind: "const"
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 160
- end: 195
loc: {...}
start: {...}
- line: 8
- column: 2
}end: {...}
- line: 8
- column: 37
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 166
- end: 194
loc: {...}
start: {...}
- line: 8
- column: 8
}end: {...}
- line: 8
- column: 36
}
}id: Identifier {...}
- type: "Identifier"
- start: 166
- end: 170
loc: {...}
start: {...}
- line: 8
- column: 8
}end: {...}
- line: 8
- column: 12
}
}- name: "data"
}init: AwaitExpression {...}
- type: "AwaitExpression"
- start: 173
- end: 194
loc: {...}
start: {...}
- line: 8
- column: 15
}end: {...}
- line: 8
- column: 36
}
}argument: CallExpression {...}
- type: "CallExpression"
- start: 179
- end: 194
loc: {...}
start: {...}
- line: 8
- column: 21
}end: {...}
- line: 8
- column: 36
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 179
- end: 192
loc: {...}
start: {...}
- line: 8
- column: 21
}end: {...}
- line: 8
- column: 34
}
}object: Identifier {...}
- type: "Identifier"
- start: 179
- end: 187
loc: {...}
start: {...}
- line: 8
- column: 21
}end: {...}
- line: 8
- column: 29
}
}- name: "response"
}property: Identifier {...}
- type: "Identifier"
- start: 188
- end: 192
loc: {...}
start: {...}
- line: 8
- column: 30
}end: {...}
- line: 8
- column: 34
}
}- name: "json"
}- computed: false
- optional: false
}- arguments: []
- optional: false
}
}
}
]- kind: "const"
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 199
- end: 235
loc: {...}
start: {...}
- line: 10
- column: 2
}end: {...}
- line: 10
- column: 38
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 205
- end: 234
loc: {...}
start: {...}
- line: 10
- column: 8
}end: {...}
- line: 10
- column: 37
}
}id: Identifier {...}
- type: "Identifier"
- start: 205
- end: 209
loc: {...}
start: {...}
- line: 10
- column: 8
}end: {...}
- line: 10
- column: 12
}
}- name: "lat1"
}init: MemberExpression {...}
- type: "MemberExpression"
- start: 212
- end: 234
loc: {...}
start: {...}
- line: 10
- column: 15
}end: {...}
- line: 10
- column: 37
}
}object: CallExpression {...}
- type: "CallExpression"
- start: 212
- end: 231
loc: {...}
start: {...}
- line: 10
- column: 15
}end: {...}
- line: 10
- column: 34
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 212
- end: 226
loc: {...}
start: {...}
- line: 10
- column: 15
}end: {...}
- line: 10
- column: 29
}
}object: MemberExpression {...}
- type: "MemberExpression"
- start: 212
- end: 220
loc: {...}
start: {...}
- line: 10
- column: 15
}end: {...}
- line: 10
- column: 23
}
}object: Identifier {...}
- type: "Identifier"
- start: 212
- end: 216
loc: {...}
start: {...}
- line: 10
- column: 15
}end: {...}
- line: 10
- column: 19
}
}- name: "data"
}property: Identifier {...}
- type: "Identifier"
- start: 217
- end: 220
loc: {...}
start: {...}
- line: 10
- column: 20
}end: {...}
- line: 10
- column: 23
}
}- name: "loc"
}- computed: false
- optional: false
}property: Identifier {...}
- type: "Identifier"
- start: 221
- end: 226
loc: {...}
start: {...}
- line: 10
- column: 24
}end: {...}
- line: 10
- column: 29
}
}- name: "split"
}- computed: false
- optional: false
}arguments: [...] (1)
Literal {...}
- type: "Literal"
- start: 227
- end: 230
loc: {...}
start: {...}
- line: 10
- column: 30
}end: {...}
- line: 10
- column: 33
}
}- value: ","
- raw: "','"
}
]- optional: false
}property: Literal {...}
- type: "Literal"
- start: 232
- end: 233
loc: {...}
start: {...}
- line: 10
- column: 35
}end: {...}
- line: 10
- column: 36
}
}- value: 0
- raw: "0"
}- computed: true
- optional: false
}
}
]- kind: "const"
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 238
- end: 274
loc: {...}
start: {...}
- line: 11
- column: 2
}end: {...}
- line: 11
- column: 38
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 244
- end: 273
loc: {...}
start: {...}
- line: 11
- column: 8
}end: {...}
- line: 11
- column: 37
}
}id: Identifier {...}
- type: "Identifier"
- start: 244
- end: 248
loc: {...}
start: {...}
- line: 11
- column: 8
}end: {...}
- line: 11
- column: 12
}
}- name: "lon1"
}init: MemberExpression {...}
- type: "MemberExpression"
- start: 251
- end: 273
loc: {...}
start: {...}
- line: 11
- column: 15
}end: {...}
- line: 11
- column: 37
}
}object: CallExpression {...}
- type: "CallExpression"
- start: 251
- end: 270
loc: {...}
start: {...}
- line: 11
- column: 15
}end: {...}
- line: 11
- column: 34
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 251
- end: 265
loc: {...}
start: {...}
- line: 11
- column: 15
}end: {...}
- line: 11
- column: 29
}
}object: MemberExpression {...}
- type: "MemberExpression"
- start: 251
- end: 259
loc: {...}
start: {...}
- line: 11
- column: 15
}end: {...}
- line: 11
- column: 23
}
}object: Identifier {...}
- type: "Identifier"
- start: 251
- end: 255
loc: {...}
start: {...}
- line: 11
- column: 15
}end: {...}
- line: 11
- column: 19
}
}- name: "data"
}property: Identifier {...}
- type: "Identifier"
- start: 256
- end: 259
loc: {...}
start: {...}
- line: 11
- column: 20
}end: {...}
- line: 11
- column: 23
}
}- name: "loc"
}- computed: false
- optional: false
}property: Identifier {...}
- type: "Identifier"
- start: 260
- end: 265
loc: {...}
start: {...}
- line: 11
- column: 24
}end: {...}
- line: 11
- column: 29
}
}- name: "split"
}- computed: false
- optional: false
}arguments: [...] (1)
Literal {...}
- type: "Literal"
- start: 266
- end: 269
loc: {...}
start: {...}
- line: 11
- column: 30
}end: {...}
- line: 11
- column: 33
}
}- value: ","
- raw: "','"
}
]- optional: false
}property: Literal {...}
- type: "Literal"
- start: 271
- end: 272
loc: {...}
start: {...}
- line: 11
- column: 35
}end: {...}
- line: 11
- column: 36
}
}- value: 1
- raw: "1"
}- computed: true
- optional: false
}
}
]- kind: "const"
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 277
- end: 296
loc: {...}
start: {...}
- line: 12
- column: 2
}end: {...}
- line: 12
- column: 21
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 283
- end: 295
loc: {...}
start: {...}
- line: 12
- column: 8
}end: {...}
- line: 12
- column: 20
}
}id: Identifier {...}
- type: "Identifier"
- start: 283
- end: 287
loc: {...}
start: {...}
- line: 12
- column: 8
}end: {...}
- line: 12
- column: 12
}
}- name: "lat2"
}init: Literal {...}
- type: "Literal"
- start: 290
- end: 295
loc: {...}
start: {...}
- line: 12
- column: 15
}end: {...}
- line: 12
- column: 20
}
}- value: 39.57
- raw: "39.57"
}
}
]- kind: "const"
trailingComments: [...] (1)
Line {...}
- type: "Line"
- value: " Mallorca latitude"
- start: 297
- end: 317
}
]
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 320
- end: 338
loc: {...}
start: {...}
- line: 13
- column: 2
}end: {...}
- line: 13
- column: 20
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 326
- end: 337
loc: {...}
start: {...}
- line: 13
- column: 8
}end: {...}
- line: 13
- column: 19
}
}id: Identifier {...}
- type: "Identifier"
- start: 326
- end: 330
loc: {...}
start: {...}
- line: 13
- column: 8
}end: {...}
- line: 13
- column: 12
}
}- name: "lon2"
}init: Literal {...}
- type: "Literal"
- start: 333
- end: 337
loc: {...}
start: {...}
- line: 13
- column: 15
}end: {...}
- line: 13
- column: 19
}
}- value: 2.65
- raw: "2.65"
}
}
]- kind: "const"
trailingComments: [...] (1)
Line {...}
- type: "Line"
- value: " Mallorca longitude"
- start: 339
- end: 360
}
]
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 364
- end: 379
loc: {...}
start: {...}
- line: 15
- column: 2
}end: {...}
- line: 15
- column: 17
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 370
- end: 378
loc: {...}
start: {...}
- line: 15
- column: 8
}end: {...}
- line: 15
- column: 16
}
}id: Identifier {...}
- type: "Identifier"
- start: 370
- end: 371
loc: {...}
start: {...}
- line: 15
- column: 8
}end: {...}
- line: 15
- column: 9
}
}- name: "R"
}init: Literal {...}
- type: "Literal"
- start: 374
- end: 378
loc: {...}
start: {...}
- line: 15
- column: 12
}end: {...}
- line: 15
- column: 16
}
}- value: 6371
- raw: "6371"
}
}
]- kind: "const"
trailingComments: [...] (1)
Line {...}
- type: "Line"
- value: " Earth's radius in KM"
- start: 380
- end: 403
}
]
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 407
- end: 450
loc: {...}
start: {...}
- line: 17
- column: 2
}end: {...}
- line: 17
- column: 45
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 413
- end: 449
loc: {...}
start: {...}
- line: 17
- column: 8
}end: {...}
- line: 17
- column: 44
}
}id: Identifier {...}
- type: "Identifier"
- start: 413
- end: 417
loc: {...}
start: {...}
- line: 17
- column: 8
}end: {...}
- line: 17
- column: 12
}
}- name: "dLat"
}init: BinaryExpression {...}
- type: "BinaryExpression"
- start: 420
- end: 449
loc: {...}
start: {...}
- line: 17
- column: 15
}end: {...}
- line: 17
- column: 44
}
}left: BinaryExpression {...}
- type: "BinaryExpression"
- start: 420
- end: 443
loc: {...}
start: {...}
- line: 17
- column: 15
}end: {...}
- line: 17
- column: 38
}
}left: BinaryExpression {...}
- type: "BinaryExpression"
- start: 421
- end: 432
loc: {...}
start: {...}
- line: 17
- column: 16
}end: {...}
- line: 17
- column: 27
}
}left: Identifier {...}
- type: "Identifier"
- start: 421
- end: 425
loc: {...}
start: {...}
- line: 17
- column: 16
}end: {...}
- line: 17
- column: 20
}
}- name: "lat2"
}- operator: "-"
right: Identifier {...}
- type: "Identifier"
- start: 428
- end: 432
loc: {...}
start: {...}
- line: 17
- column: 23
}end: {...}
- line: 17
- column: 27
}
}- name: "lat1"
}
}- operator: "*"
right: MemberExpression {...}
- type: "MemberExpression"
- start: 436
- end: 443
loc: {...}
start: {...}
- line: 17
- column: 31
}end: {...}
- line: 17
- column: 38
}
}object: Identifier {...}
- type: "Identifier"
- start: 436
- end: 440
loc: {...}
start: {...}
- line: 17
- column: 31
}end: {...}
- line: 17
- column: 35
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 441
- end: 443
loc: {...}
start: {...}
- line: 17
- column: 36
}end: {...}
- line: 17
- column: 38
}
}- name: "PI"
}- computed: false
- optional: false
}
}- operator: "/"
right: Literal {...}
- type: "Literal"
- start: 446
- end: 449
loc: {...}
start: {...}
- line: 17
- column: 41
}end: {...}
- line: 17
- column: 44
}
}- value: 180
- raw: "180"
}
}
}
]- kind: "const"
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 453
- end: 496
loc: {...}
start: {...}
- line: 18
- column: 2
}end: {...}
- line: 18
- column: 45
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 459
- end: 495
loc: {...}
start: {...}
- line: 18
- column: 8
}end: {...}
- line: 18
- column: 44
}
}id: Identifier {...}
- type: "Identifier"
- start: 459
- end: 463
loc: {...}
start: {...}
- line: 18
- column: 8
}end: {...}
- line: 18
- column: 12
}
}- name: "dLon"
}init: BinaryExpression {...}
- type: "BinaryExpression"
- start: 466
- end: 495
loc: {...}
start: {...}
- line: 18
- column: 15
}end: {...}
- line: 18
- column: 44
}
}left: BinaryExpression {...}
- type: "BinaryExpression"
- start: 466
- end: 489
loc: {...}
start: {...}
- line: 18
- column: 15
}end: {...}
- line: 18
- column: 38
}
}left: BinaryExpression {...}
- type: "BinaryExpression"
- start: 467
- end: 478
loc: {...}
start: {...}
- line: 18
- column: 16
}end: {...}
- line: 18
- column: 27
}
}left: Identifier {...}
- type: "Identifier"
- start: 467
- end: 471
loc: {...}
start: {...}
- line: 18
- column: 16
}end: {...}
- line: 18
- column: 20
}
}- name: "lon2"
}- operator: "-"
right: Identifier {...}
- type: "Identifier"
- start: 474
- end: 478
loc: {...}
start: {...}
- line: 18
- column: 23
}end: {...}
- line: 18
- column: 27
}
}- name: "lon1"
}
}- operator: "*"
right: MemberExpression {...}
- type: "MemberExpression"
- start: 482
- end: 489
loc: {...}
start: {...}
- line: 18
- column: 31
}end: {...}
- line: 18
- column: 38
}
}object: Identifier {...}
- type: "Identifier"
- start: 482
- end: 486
loc: {...}
start: {...}
- line: 18
- column: 31
}end: {...}
- line: 18
- column: 35
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 487
- end: 489
loc: {...}
start: {...}
- line: 18
- column: 36
}end: {...}
- line: 18
- column: 38
}
}- name: "PI"
}- computed: false
- optional: false
}
}- operator: "/"
right: Literal {...}
- type: "Literal"
- start: 492
- end: 495
loc: {...}
start: {...}
- line: 18
- column: 41
}end: {...}
- line: 18
- column: 44
}
}- value: 180
- raw: "180"
}
}
}
]- kind: "const"
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 500
- end: 673
loc: {...}
start: {...}
- line: 20
- column: 2
}end: {...}
- line: 23
- column: 45
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 506
- end: 672
loc: {...}
start: {...}
- line: 20
- column: 8
}end: {...}
- line: 23
- column: 44
}
}id: Identifier {...}
- type: "Identifier"
- start: 506
- end: 507
loc: {...}
start: {...}
- line: 20
- column: 8
}end: {...}
- line: 20
- column: 9
}
}- name: "a"
}init: BinaryExpression {...}
- type: "BinaryExpression"
- start: 515
- end: 672
loc: {...}
start: {...}
- line: 21
- column: 5
}end: {...}
- line: 23
- column: 44
}
}left: BinaryExpression {...}
- type: "BinaryExpression"
- start: 515
- end: 554
loc: {...}
start: {...}
- line: 21
- column: 5
}end: {...}
- line: 21
- column: 44
}
}left: CallExpression {...}
- type: "CallExpression"
- start: 515
- end: 533
loc: {...}
start: {...}
- line: 21
- column: 5
}end: {...}
- line: 21
- column: 23
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 515
- end: 523
loc: {...}
start: {...}
- line: 21
- column: 5
}end: {...}
- line: 21
- column: 13
}
}object: Identifier {...}
- type: "Identifier"
- start: 515
- end: 519
loc: {...}
start: {...}
- line: 21
- column: 5
}end: {...}
- line: 21
- column: 9
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 520
- end: 523
loc: {...}
start: {...}
- line: 21
- column: 10
}end: {...}
- line: 21
- column: 13
}
}- name: "sin"
}- computed: false
- optional: false
}arguments: [...] (1)
BinaryExpression {...}
- type: "BinaryExpression"
- start: 524
- end: 532
loc: {...}
start: {...}
- line: 21
- column: 14
}end: {...}
- line: 21
- column: 22
}
}left: Identifier {...}
- type: "Identifier"
- start: 524
- end: 528
loc: {...}
start: {...}
- line: 21
- column: 14
}end: {...}
- line: 21
- column: 18
}
}- name: "dLat"
}- operator: "/"
right: Literal {...}
- type: "Literal"
- start: 531
- end: 532
loc: {...}
start: {...}
- line: 21
- column: 21
}end: {...}
- line: 21
- column: 22
}
}- value: 2
- raw: "2"
}
}
]- optional: false
}- operator: "*"
right: CallExpression {...}
- type: "CallExpression"
- start: 536
- end: 554
loc: {...}
start: {...}
- line: 21
- column: 26
}end: {...}
- line: 21
- column: 44
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 536
- end: 544
loc: {...}
start: {...}
- line: 21
- column: 26
}end: {...}
- line: 21
- column: 34
}
}object: Identifier {...}
- type: "Identifier"
- start: 536
- end: 540
loc: {...}
start: {...}
- line: 21
- column: 26
}end: {...}
- line: 21
- column: 30
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 541
- end: 544
loc: {...}
start: {...}
- line: 21
- column: 31
}end: {...}
- line: 21
- column: 34
}
}- name: "sin"
}- computed: false
- optional: false
}arguments: [...] (1)
BinaryExpression {...}
- type: "BinaryExpression"
- start: 545
- end: 553
loc: {...}
start: {...}
- line: 21
- column: 35
}end: {...}
- line: 21
- column: 43
}
}left: Identifier {...}
- type: "Identifier"
- start: 545
- end: 549
loc: {...}
start: {...}
- line: 21
- column: 35
}end: {...}
- line: 21
- column: 39
}
}- name: "dLat"
}- operator: "/"
right: Literal {...}
- type: "Literal"
- start: 552
- end: 553
loc: {...}
start: {...}
- line: 21
- column: 42
}end: {...}
- line: 21
- column: 43
}
}- value: 2
- raw: "2"
}
}
]- optional: false
}
}- operator: "+"
right: BinaryExpression {...}
- type: "BinaryExpression"
- start: 562
- end: 672
loc: {...}
start: {...}
- line: 22
- column: 5
}end: {...}
- line: 23
- column: 44
}
}left: BinaryExpression {...}
- type: "BinaryExpression"
- start: 562
- end: 651
loc: {...}
start: {...}
- line: 22
- column: 5
}end: {...}
- line: 23
- column: 23
}
}left: BinaryExpression {...}
- type: "BinaryExpression"
- start: 562
- end: 625
loc: {...}
start: {...}
- line: 22
- column: 5
}end: {...}
- line: 22
- column: 68
}
}left: CallExpression {...}
- type: "CallExpression"
- start: 562
- end: 592
loc: {...}
start: {...}
- line: 22
- column: 5
}end: {...}
- line: 22
- column: 35
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 562
- end: 570
loc: {...}
start: {...}
- line: 22
- column: 5
}end: {...}
- line: 22
- column: 13
}
}object: Identifier {...}
- type: "Identifier"
- start: 562
- end: 566
loc: {...}
start: {...}
- line: 22
- column: 5
}end: {...}
- line: 22
- column: 9
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 567
- end: 570
loc: {...}
start: {...}
- line: 22
- column: 10
}end: {...}
- line: 22
- column: 13
}
}- name: "cos"
}- computed: false
- optional: false
}arguments: [...] (1)
BinaryExpression {...}
- type: "BinaryExpression"
- start: 571
- end: 591
loc: {...}
start: {...}
- line: 22
- column: 14
}end: {...}
- line: 22
- column: 34
}
}left: BinaryExpression {...}
- type: "BinaryExpression"
- start: 571
- end: 585
loc: {...}
start: {...}
- line: 22
- column: 14
}end: {...}
- line: 22
- column: 28
}
}left: Identifier {...}
- type: "Identifier"
- start: 571
- end: 575
loc: {...}
start: {...}
- line: 22
- column: 14
}end: {...}
- line: 22
- column: 18
}
}- name: "lat1"
}- operator: "*"
right: MemberExpression {...}
- type: "MemberExpression"
- start: 578
- end: 585
loc: {...}
start: {...}
- line: 22
- column: 21
}end: {...}
- line: 22
- column: 28
}
}object: Identifier {...}
- type: "Identifier"
- start: 578
- end: 582
loc: {...}
start: {...}
- line: 22
- column: 21
}end: {...}
- line: 22
- column: 25
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 583
- end: 585
loc: {...}
start: {...}
- line: 22
- column: 26
}end: {...}
- line: 22
- column: 28
}
}- name: "PI"
}- computed: false
- optional: false
}
}- operator: "/"
right: Literal {...}
- type: "Literal"
- start: 588
- end: 591
loc: {...}
start: {...}
- line: 22
- column: 31
}end: {...}
- line: 22
- column: 34
}
}- value: 180
- raw: "180"
}
}
]- optional: false
}- operator: "*"
right: CallExpression {...}
- type: "CallExpression"
- start: 595
- end: 625
loc: {...}
start: {...}
- line: 22
- column: 38
}end: {...}
- line: 22
- column: 68
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 595
- end: 603
loc: {...}
start: {...}
- line: 22
- column: 38
}end: {...}
- line: 22
- column: 46
}
}object: Identifier {...}
- type: "Identifier"
- start: 595
- end: 599
loc: {...}
start: {...}
- line: 22
- column: 38
}end: {...}
- line: 22
- column: 42
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 600
- end: 603
loc: {...}
start: {...}
- line: 22
- column: 43
}end: {...}
- line: 22
- column: 46
}
}- name: "cos"
}- computed: false
- optional: false
}arguments: [...] (1)
BinaryExpression {...}
- type: "BinaryExpression"
- start: 604
- end: 624
loc: {...}
start: {...}
- line: 22
- column: 47
}end: {...}
- line: 22
- column: 67
}
}left: BinaryExpression {...}
- type: "BinaryExpression"
- start: 604
- end: 618
loc: {...}
start: {...}
- line: 22
- column: 47
}end: {...}
- line: 22
- column: 61
}
}left: Identifier {...}
- type: "Identifier"
- start: 604
- end: 608
loc: {...}
start: {...}
- line: 22
- column: 47
}end: {...}
- line: 22
- column: 51
}
}- name: "lat2"
}- operator: "*"
right: MemberExpression {...}
- type: "MemberExpression"
- start: 611
- end: 618
loc: {...}
start: {...}
- line: 22
- column: 54
}end: {...}
- line: 22
- column: 61
}
}object: Identifier {...}
- type: "Identifier"
- start: 611
- end: 615
loc: {...}
start: {...}
- line: 22
- column: 54
}end: {...}
- line: 22
- column: 58
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 616
- end: 618
loc: {...}
start: {...}
- line: 22
- column: 59
}end: {...}
- line: 22
- column: 61
}
}- name: "PI"
}- computed: false
- optional: false
}
}- operator: "/"
right: Literal {...}
- type: "Literal"
- start: 621
- end: 624
loc: {...}
start: {...}
- line: 22
- column: 64
}end: {...}
- line: 22
- column: 67
}
}- value: 180
- raw: "180"
}
}
]- optional: false
}
}- operator: "*"
right: CallExpression {...}
- type: "CallExpression"
- start: 633
- end: 651
loc: {...}
start: {...}
- line: 23
- column: 5
}end: {...}
- line: 23
- column: 23
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 633
- end: 641
loc: {...}
start: {...}
- line: 23
- column: 5
}end: {...}
- line: 23
- column: 13
}
}object: Identifier {...}
- type: "Identifier"
- start: 633
- end: 637
loc: {...}
start: {...}
- line: 23
- column: 5
}end: {...}
- line: 23
- column: 9
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 638
- end: 641
loc: {...}
start: {...}
- line: 23
- column: 10
}end: {...}
- line: 23
- column: 13
}
}- name: "sin"
}- computed: false
- optional: false
}arguments: [...] (1)
BinaryExpression {...}
- type: "BinaryExpression"
- start: 642
- end: 650
loc: {...}
start: {...}
- line: 23
- column: 14
}end: {...}
- line: 23
- column: 22
}
}left: Identifier {...}
- type: "Identifier"
- start: 642
- end: 646
loc: {...}
start: {...}
- line: 23
- column: 14
}end: {...}
- line: 23
- column: 18
}
}- name: "dLon"
}- operator: "/"
right: Literal {...}
- type: "Literal"
- start: 649
- end: 650
loc: {...}
start: {...}
- line: 23
- column: 21
}end: {...}
- line: 23
- column: 22
}
}- value: 2
- raw: "2"
}
}
]- optional: false
}
}- operator: "*"
right: CallExpression {...}
- type: "CallExpression"
- start: 654
- end: 672
loc: {...}
start: {...}
- line: 23
- column: 26
}end: {...}
- line: 23
- column: 44
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 654
- end: 662
loc: {...}
start: {...}
- line: 23
- column: 26
}end: {...}
- line: 23
- column: 34
}
}object: Identifier {...}
- type: "Identifier"
- start: 654
- end: 658
loc: {...}
start: {...}
- line: 23
- column: 26
}end: {...}
- line: 23
- column: 30
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 659
- end: 662
loc: {...}
start: {...}
- line: 23
- column: 31
}end: {...}
- line: 23
- column: 34
}
}- name: "sin"
}- computed: false
- optional: false
}arguments: [...] (1)
BinaryExpression {...}
- type: "BinaryExpression"
- start: 663
- end: 671
loc: {...}
start: {...}
- line: 23
- column: 35
}end: {...}
- line: 23
- column: 43
}
}left: Identifier {...}
- type: "Identifier"
- start: 663
- end: 667
loc: {...}
start: {...}
- line: 23
- column: 35
}end: {...}
- line: 23
- column: 39
}
}- name: "dLon"
}- operator: "/"
right: Literal {...}
- type: "Literal"
- start: 670
- end: 671
loc: {...}
start: {...}
- line: 23
- column: 42
}end: {...}
- line: 23
- column: 43
}
}- value: 2
- raw: "2"
}
}
]- optional: false
}
}
}
}
]- kind: "const"
} VariableDeclaration {...}
- type: "VariableDeclaration"
- start: 677
- end: 734
loc: {...}
start: {...}
- line: 25
- column: 2
}end: {...}
- line: 25
- column: 59
}
}declarations: [...] (1)
VariableDeclarator {...}
- type: "VariableDeclarator"
- start: 683
- end: 733
loc: {...}
start: {...}
- line: 25
- column: 8
}end: {...}
- line: 25
- column: 58
}
}id: Identifier {...}
- type: "Identifier"
- start: 683
- end: 684
loc: {...}
start: {...}
- line: 25
- column: 8
}end: {...}
- line: 25
- column: 9
}
}- name: "c"
}init: BinaryExpression {...}
- type: "BinaryExpression"
- start: 687
- end: 733
loc: {...}
start: {...}
- line: 25
- column: 12
}end: {...}
- line: 25
- column: 58
}
}left: Literal {...}
- type: "Literal"
- start: 687
- end: 688
loc: {...}
start: {...}
- line: 25
- column: 12
}end: {...}
- line: 25
- column: 13
}
}- value: 2
- raw: "2"
}- operator: "*"
right: CallExpression {...}
- type: "CallExpression"
- start: 691
- end: 733
loc: {...}
start: {...}
- line: 25
- column: 16
}end: {...}
- line: 25
- column: 58
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 691
- end: 701
loc: {...}
start: {...}
- line: 25
- column: 16
}end: {...}
- line: 25
- column: 26
}
}object: Identifier {...}
- type: "Identifier"
- start: 691
- end: 695
loc: {...}
start: {...}
- line: 25
- column: 16
}end: {...}
- line: 25
- column: 20
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 696
- end: 701
loc: {...}
start: {...}
- line: 25
- column: 21
}end: {...}
- line: 25
- column: 26
}
}- name: "atan2"
}- computed: false
- optional: false
}arguments: [...] (2)
CallExpression {...}
- type: "CallExpression"
- start: 702
- end: 714
loc: {...}
start: {...}
- line: 25
- column: 27
}end: {...}
- line: 25
- column: 39
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 702
- end: 711
loc: {...}
start: {...}
- line: 25
- column: 27
}end: {...}
- line: 25
- column: 36
}
}object: Identifier {...}
- type: "Identifier"
- start: 702
- end: 706
loc: {...}
start: {...}
- line: 25
- column: 27
}end: {...}
- line: 25
- column: 31
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 707
- end: 711
loc: {...}
start: {...}
- line: 25
- column: 32
}end: {...}
- line: 25
- column: 36
}
}- name: "sqrt"
}- computed: false
- optional: false
}arguments: [...] (1)
Identifier {...}
- type: "Identifier"
- start: 712
- end: 713
loc: {...}
start: {...}
- line: 25
- column: 37
}end: {...}
- line: 25
- column: 38
}
}- name: "a"
}
]- optional: false
} CallExpression {...}
- type: "CallExpression"
- start: 716
- end: 732
loc: {...}
start: {...}
- line: 25
- column: 41
}end: {...}
- line: 25
- column: 57
}
}callee: MemberExpression {...}
- type: "MemberExpression"
- start: 716
- end: 725
loc: {...}
start: {...}
- line: 25
- column: 41
}end: {...}
- line: 25
- column: 50
}
}object: Identifier {...}
- type: "Identifier"
- start: 716
- end: 720
loc: {...}
start: {...}
- line: 25
- column: 41
}end: {...}
- line: 25
- column: 45
}
}- name: "Math"
}property: Identifier {...}
- type: "Identifier"
- start: 721
- end: 725
loc: {...}
start: {...}
- line: 25
- column: 46
}end: {...}
- line: 25
- column: 50
}
}- name: "sqrt"
}- computed: false
- optional: false
}arguments: [...] (1)
BinaryExpression {...}
- type: "BinaryExpression"
- start: 726
- end: 731
loc: {...}
start: {...}
- line: 25
- column: 51
}end: {...}
- line: 25
- column: 56
}
}left: Literal {...}
- type: "Literal"
- start: 726
- end: 727
loc: {...}
start: {...}
- line: 25
- column: 51
}end: {...}
- line: 25
- column: 52
}
}- value: 1
- raw: "1"
}- operator: "-"
right: Identifier {...}
- type: "Identifier"
- start: 730
- end: 731
loc: {...}
start: {...}
- line: 25
- column: 55
}end: {...}
- line: 25
- column: 56
}
}- name: "a"
}
}
]- optional: false
}
]- optional: false
}
}
}
]- kind: "const"
} ExpressionStatement {...}
- type: "ExpressionStatement"
- start: 738
- end: 755
loc: {...}
start: {...}
- line: 27
- column: 2
}end: {...}
- line: 27
- column: 19
}
}expression: AssignmentExpression {...}
- type: "AssignmentExpression"
- start: 738
- end: 754
loc: {...}
start: {...}
- line: 27
- column: 2
}end: {...}
- line: 27
- column: 18
}
}- operator: "="
left: Identifier {...}
- type: "Identifier"
- start: 738
- end: 746
loc: {...}
start: {...}
- line: 27
- column: 2
}end: {...}
- line: 27
- column: 10
}
}- name: "distance"
}right: BinaryExpression {...}
- type: "BinaryExpression"
- start: 749
- end: 754
loc: {...}
start: {...}
- line: 27
- column: 13
}end: {...}
- line: 27
- column: 18
}
}left: Identifier {...}
- type: "Identifier"
- start: 749
- end: 750
loc: {...}
start: {...}
- line: 27
- column: 13
}end: {...}
- line: 27
- column: 14
}
}- name: "R"
}- operator: "*"
right: Identifier {...}
- type: "Identifier"
- start: 753
- end: 754
loc: {...}
start: {...}
- line: 27
- column: 17
}end: {...}
- line: 27
- column: 18
}
}- name: "c"
}
}
}
}
]
}
} ExpressionStatement {...}
- type: "ExpressionStatement"
- start: 761
- end: 798
loc: {...}
start: {...}
- line: 30
- column: 1
}end: {...}
- line: 32
- column: 4
}
}expression: CallExpression {...}
- type: "CallExpression"
- start: 761
- end: 797
loc: {...}
start: {...}
- line: 30
- column: 1
}end: {...}
- line: 32
- column: 3
}
}callee: Identifier {...}
- type: "Identifier"
- start: 761
- end: 768
loc: {...}
start: {...}
- line: 30
- column: 1
}end: {...}
- line: 30
- column: 8
}
}- name: "onMount"
}arguments: [...] (1)
ArrowFunctionExpression {...}
- type: "ArrowFunctionExpression"
- start: 769
- end: 796
loc: {...}
start: {...}
- line: 30
- column: 9
}end: {...}
- line: 32
- column: 2
}
}- id: null
- expression: false
- generator: false
- async: false
- params: []
body: BlockStatement {...}
- type: "BlockStatement"
- start: 775
- end: 796
loc: {...}
start: {...}
- line: 30
- column: 15
}end: {...}
- line: 32
- column: 2
}
}body: [...] (1)
ExpressionStatement {...}
- type: "ExpressionStatement"
- start: 779
- end: 793
loc: {...}
start: {...}
- line: 31
- column: 2
}end: {...}
- line: 31
- column: 16
}
}expression: CallExpression {...}
- type: "CallExpression"
- start: 779
- end: 792
loc: {...}
start: {...}
- line: 31
- column: 2
}end: {...}
- line: 31
- column: 15
}
}callee: Identifier {...}
- type: "Identifier"
- start: 779
- end: 790
loc: {...}
start: {...}
- line: 31
- column: 2
}end: {...}
- line: 31
- column: 13
}
}- name: "getLocation"
}- arguments: []
- optional: false
}
}
]
}
}
]- optional: false
}
}
]- sourceType: "module"
}- attributes: []
}
}
The AST is not public API and may change at any point in time