JavaScript Ramblings
  • Home
Sign in Subscribe

Latest

How to change object values without assigning it to another object

You have two variables, one referencing the other one like this: var person = { name: "John" }; var luckyWinner = person; Now, say want to get some data from an AJAX call and assign it to person, but you also want luckyWinner to keep the reference: // say we received updatedPerson = { name: "Jonathan" } from
Corina Jun 11, 2016

What does this "for .. in" expression do

You are used to the classic way of iterating through an array: var data = [ 'a', 'b', 'c' ]; for(var i=0; i
Corina Jun 11, 2016

Subscribe to JavaScript Ramblings

Don't miss out on new articles. Sign up now get them straight to your inbox.
JavaScript Ramblings © 2025. Powered by Ghost