© 2026 LinearBytes Inc.
Search posts, tags, users, and pages
Will
When should one use some-var and {some-var}.
some-
var
{some-
}
Calvin Koepke
Software engineer specializing in headless WordPress.
Not sure what you mean. Neither of those are variable declarations in JavaScript. I think you might be referring to something like this?
const varName = { param: 'This is a string.', integer: 25 }; console.log(varName); // Prints the above object. const { integer } = varName; console.log(integer); // Prints 25
If you're asking what is a "variable" in general, it's a computer programming concept of storing a value in a keyword that can be retrieved and/or modified later.
Calvin Koepke
Software engineer specializing in headless WordPress.
Not sure what you mean. Neither of those are variable declarations in JavaScript. I think you might be referring to something like this?
const varName = { param: 'This is a string.', integer: 25 }; console.log(varName); // Prints the above object. const { integer } = varName; console.log(integer); // Prints 25