Linked Questions

1 vote
0 answers
253 views

Here is some source code from jquery, namely from the function jQuery.speed that deals with animations: jQuery.speed = function( speed, easing, fn ) { var opt = speed && typeof speed === "...
AlexZ's user avatar
  • 12.2k
0 votes
1 answer
179 views

Having typescript code presented below, which creates new record in the Firestore database, is it possible to omit (by writing one line of inline code) one of the key-value pair if the value equals ...
Eric's user avatar
  • 1,795
0 votes
1 answer
80 views

How do I add an if statement in a return statement of this sort: return { ID: select('core/editor').getEditedPostAttribute('featured_media'), if (ID) { media: select('core').getMedia( ...
Henrik Petterson's user avatar
1 vote
4 answers
90 views

Given an Object s as s = { a:1, b:2 } I can define a new object t with fields depending on the contents of s, say something like t = { d: s.a ? 1 : 2 } then the field d value depends on ...
Malice's user avatar
  • 1,482
0 votes
0 answers
161 views

I have looked for an answer to this and Haven't quite been able to find it. Is it possible to have an object that includes/excludes keys dynamically? Consider these two examples: Example 1 const ...
Garrett's user avatar
  • 1,818
0 votes
2 answers
105 views

var args = {VehicleManipulation:[{ 'a:Amount':[Amount], 'a:Comment':[Comment], 'a:Date':[date], 'a:...
Bobek's user avatar
  • 757
0 votes
0 answers
48 views

Consider the following example: const initObject = { a: 2, b: 3, c: 4 }; let shouldChangeB = false; const newB = 4 const newObject = { ...initObject, //shouldChangeB && b: newB - ...
Gergő Horváth's user avatar
0 votes
0 answers
41 views

Basically I'm trying to compare two objects in javascript that have different key names, but I want to match the values of the the objectToSync with the values of the mainObject. Some of the values ...
yayza's user avatar
  • 63
0 votes
0 answers
40 views

This is the default behavior of computed properties in JS: const yourName = 'John'; const resultObject = { [yourName]: 'Glad you're here, let's celebrate!' } The resultObject will be computed to ...
paroxyzm's user avatar
  • 1,509
1 vote
0 answers
19 views

I have the following component taking in the prop data. <Button data={booleanValue && { d: 4, // another 8 key/values }} /> So data value only gets passed in if ...
karvai's user avatar
  • 1,836
1 vote
0 answers
18 views

Is it possible to change from below if(true){ return { ...baseData, email: profile.email, permissions: "admin", }; }else{ return { ...baseData, ...
CCCC's user avatar
  • 6,665
0 votes
0 answers
8 views

I am trying to have an optional field on object. If the state variable equals active, I want to have data.fields equal to show. If state does not equal active, I don't want terms to even be part of ...
user avatar
3823 votes
83 answers
2.5m views

I have an object x. I'd like to copy it as object y, such that changes to y do not modify x. I realized that copying objects derived from built-in JavaScript objects will result in extra, unwanted ...
soundly_typed's user avatar
966 votes
22 answers
1.0m views

In JavaScript, I've created an object like so: var data = { 'PropertyA': 1, 'PropertyB': 2, 'PropertyC': 3 }; Is it possible to add further properties to this object after its initial ...
Lee D's user avatar
  • 13k
120 votes
16 answers
203k views

Given the Card code as in here. How can I update the card style or any material UI style as from: const styles = theme => ({ card: { minWidth: 275, }, To such follows: const styles = theme =&...
Abdulrhman Alsri's user avatar

15 30 50 per page