js-runtime/example.html

13 lines
216 B
HTML
Raw Normal View History

2023-09-09 12:22:26 +01:00
<script src="runtime-checker.js"></script>
<script>
2023-09-09 12:46:41 +01:00
const sum = typedFunction((a_number, b_number) => {
2023-09-09 12:22:26 +01:00
return a + b;
2023-09-09 12:46:41 +01:00
});
2023-09-09 12:22:26 +01:00
2023-09-09 12:46:41 +01:00
const result = sum(1, 2);
2023-09-09 12:22:26 +01:00
console.log(result); // 3
sum("1", 2); // Error
</script>