A generic container that holds a value of type T.
T
import { Box } from '../src/index.js';function increment(counter: Box<number>) { counter.value++;}const counter = new Box(0);increment(counter);console.log(counter.value); // 1 Copy
import { Box } from '../src/index.js';function increment(counter: Box<number>) { counter.value++;}const counter = new Box(0);increment(counter);console.log(counter.value); // 1
A generic container that holds a value of type
T
.