amit amit - 1 year ago 60
Javascript Question

Javascript a=b=c statements

I searched through the internets but could not find a relevant search criteria so I thought this would be the best place to ask.

I have a JS statement saying

document.location.hash = this.slug = this.sliceHashFromHref(href)


How does this work??

Answer Source

Its get evaluted from right to left. i.e

document.location.hash = this.slug = this.sliceHashFromHref(href)

output/value of

this.sliceHashFromHref(href)

is get assigned to document.location.hash = this.slug