variance of a portfolio with n assets

w3schools try it yourself javascript