When working with Javascript Object literals, I am facing an issue where string attributes cannot be concatenated properly.
var cart = {
baseURL : "http://www.domain.com/",
addURL : this.baseURL + "cart/add",
deleteURL : this.baseURL + "cart/delete",
totalURL : this.baseURL + "cart/total",
// functions
}// cart
As a result, the link generated is
http://www.domain.com/undefinedcart/add
I would really appreciate any guidance on how to resolve this issue. Thank you in advance.