Linked Questions

505 votes
16 answers
208k views

Other than the obvious fact that the first form could use a variable and not just a string literal, is there any reason to use one over the other, and if so under which cases? In code: // Given: var ...
Mark Renouf's user avatar
  • 31.1k
1 vote
3 answers
2k views

Hi I have an object that I have filled from data in a CSV file. One of my ids is called "Disk_Usage(MB)" I try using my object.Disk_Usage(MB) but receive an error because javascript thinks disk ...
cching's user avatar
  • 809
-1 votes
2 answers
64 views

I have stumbled upon something that bugs me. I had to copy one object so I have written a helper function for that task. function deepCopy2(target, obj) { for (var prop in obj) { if (obj....
Matus Dubrava's user avatar
0 votes
1 answer
72 views

I have a question about delete object propery,for examble: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>test</title> </...
Likai's user avatar
  • 29
0 votes
0 answers
53 views

Assume blog is my object/array. Is one defined for objects and one for arrays? What is the fundamental difference between them and where do I use which one?
Aditya Prakash's user avatar
0 votes
0 answers
39 views

I want to make this code shorter. const coupons = rets.map((ret) => ({ coupon_id: ret.coupon_id, bot_id: ret.bot_id, lang_cd: ret.lang_cd, coupon_name: ret.coupon_name, start_date: ret....
user avatar
0 votes
0 answers
20 views

Trying to solve a problem with linked lists requiring the conversion of a singly linked list into doubly linked list. I'm definitely missing some syntax to do this but I haven't been able to figure ...
user19568466's user avatar
653 votes
14 answers
380k views

Which characters can be used for naming a JavaScript variable? I want to create a small "extension library" for my non-JavaScript users here at work (who all seem to be squeamish when it comes to the ...
Richard Clayton's user avatar
6 votes
5 answers
11k views

Why it's not possible to access to array element with dot notation? var arr = ['Apple', 'Mango', 'Pineapple', 'Orange', {name: 'Banana', color: 'yellow'}]; console.log( arr[0] ); // "Apple" console....
Yukulélé's user avatar
  • 17.4k
1 vote
1 answer
3k views

I am new to jQuery. I have got an error when I try to get data from fileresult.php. fileresult.php $return_arr = array(); $row_array['status'] = 'Ok'; $row_array['message'] = 'good' array_push($...
Thameem's user avatar
  • 3,656
0 votes
2 answers
2k views

How can I get the value of a object in coffeescript: {text="mytext", @name="Jon"} object.text works great but can`t get object.@name and is a 3party api json object (ebay api for example use a ...
Josebyte's user avatar
0 votes
3 answers
1k views

I just started to learn Angular, and I tried to make concat var name so I can control it dynamically. This is what I tried - <div ng-app="myApp" ng-controller="myCtrl"> <button ng-click="...
J. Doe's user avatar
  • 75
1 vote
3 answers
73 views

Let a = {a: 1, b:2}, whichs shows in console Object {a: 1, b: 2}. When I do a.a I get 1. When I do a[a] I get undefined. Is it normal ? I'm asking this because I need to get values from dynamic ...
Alex's user avatar
  • 2,076
0 votes
6 answers
98 views

Can someone explain to me why this code is working ? [1,4,5,6,7,2,3]["sort"](0); //[1, 2, 3, 4, 5, 6, 7] I'm not quite understanding the syntax here. Meanwhile, why can't I use like this to choose ...
Johnny Chen's user avatar
  • 2,072
3 votes
1 answer
521 views

I have to make sense of a codebase I was given on my new job. I can see many anti-patterns here, one of them is a "god object", which contains a lot of things and different object access it all the ...
shal's user avatar
  • 3,054

15 30 50 per page