how to create a random 2d vector in js

JavaScript
let vector = p5.Vector.random2D();
Source

Also in JavaScript: