that’s not really a thing in JS as Math isn’t imported, it’s just an object available globally. the closest you can get is like const { random: getRandom } = Mathbut that’s just uglier.
the implication is that this function is exported from a library so they have to keep the function around - obviously in a modern project you’d just do Math.random()
that’s not really a thing in JS as Math isn’t imported, it’s just an object available globally. the closest you can get is like
const { random: getRandom } = Mathbut that’s just uglier.the implication is that this function is exported from a library so they have to keep the function around - obviously in a modern project you’d just do
Math.random()