23 lines
302 B
HTML
23 lines
302 B
HTML
<script src="runtime-checker.js"></script>
|
|
|
|
<script>
|
|
const sum = typedFunction((a_number, b_number) => {
|
|
return a + b;
|
|
});
|
|
|
|
const result = sum(1, 2);
|
|
console.log(result); // 3
|
|
|
|
sum("1", 2); // Error
|
|
|
|
</script>
|
|
|
|
<script>
|
|
typedVar("test", 5);
|
|
|
|
test = 6;
|
|
|
|
test = "a string"; // Error
|
|
</script>
|
|
|