Quantcast
Channel: create a new array and push into it in one line - Javascript OOP - Stack Overflow
Viewing all articles
Browse latest Browse all 4

Answer by Nina Scholz for create a new array and push into it in one line - Javascript OOP

$
0
0

Just take the value in an array.

function Spot(value) {    this.x = null;    this.y = null;    this.values = [value];}var point = new Spot('foo')console.log(point);

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>