Javascript examples for Object:Object Literal
Create Object with object literal
<html> <head> <title>SO - 28710580</title> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <script type="text/javascript"> function x() {/* w ww. ja v a 2 s . c o m*/ var obj = { price208: '23432', price308: '123' } var model = '208'; console.log(obj['price' + model]) } x(); </script> </body> </html>