Extracting data from vue-chartjs into an array of datasets
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
2
down vote
favorite
I have a function which returns an array of datasets for a chart written with vue-chartjs. The getter getChartData
returns an array with three objects with nested objects. I see that my function has a so called 'callback hell' and I want to refactor this.
getDatasets()
let datasetLabels = ;
const obj = this.getChartData;
Object.entries(obj).forEach((entry) =>
datasetLabels = [...datasetLabels, ...Object.keys(entry[1])];
);
let datasets = ;
[...new Set(datasetLabels)].forEach((item, index, arr) =>
datasets.push( label: item, backgroundColor: this.getColor(arr, index), data: );
);
Object.entries(obj).forEach((el) =>
const datasetData = Object.entries(el[1]);
datasetData.forEach(
(item) =>
datasets = datasets.map((e) =>
if (e.label === item[0])
e.data.push(item[1].median);
return e;
);
);
);
return datasets;
,
javascript callback vue.js
add a comment |Â
up vote
2
down vote
favorite
I have a function which returns an array of datasets for a chart written with vue-chartjs. The getter getChartData
returns an array with three objects with nested objects. I see that my function has a so called 'callback hell' and I want to refactor this.
getDatasets()
let datasetLabels = ;
const obj = this.getChartData;
Object.entries(obj).forEach((entry) =>
datasetLabels = [...datasetLabels, ...Object.keys(entry[1])];
);
let datasets = ;
[...new Set(datasetLabels)].forEach((item, index, arr) =>
datasets.push( label: item, backgroundColor: this.getColor(arr, index), data: );
);
Object.entries(obj).forEach((el) =>
const datasetData = Object.entries(el[1]);
datasetData.forEach(
(item) =>
datasets = datasets.map((e) =>
if (e.label === item[0])
e.data.push(item[1].median);
return e;
);
);
);
return datasets;
,
javascript callback vue.js
2
Welcome to Code Review! The current question title, which states your concerns about the code, is too general to be useful here. Please edit to the site standard, which is for the title to simply state the task accomplished by the code. Please see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
May 22 at 8:23
2
No need to wait until next time - you can still edit to improve your question (but we don't allow you to change the actual code once you've received an answer!).
â Toby Speight
May 22 at 9:08
Already done. :)
â Olga B
May 22 at 9:35
1
Please take note of the link that Toby provided, it states: "Use a title that is catchy, and describes the problem your code solvesUse a title that is catchy, and describes the problem your code solves
" please describe what the code does in your title, not an issue you wish to resolve.
â Malachiâ¦
May 22 at 13:44
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I have a function which returns an array of datasets for a chart written with vue-chartjs. The getter getChartData
returns an array with three objects with nested objects. I see that my function has a so called 'callback hell' and I want to refactor this.
getDatasets()
let datasetLabels = ;
const obj = this.getChartData;
Object.entries(obj).forEach((entry) =>
datasetLabels = [...datasetLabels, ...Object.keys(entry[1])];
);
let datasets = ;
[...new Set(datasetLabels)].forEach((item, index, arr) =>
datasets.push( label: item, backgroundColor: this.getColor(arr, index), data: );
);
Object.entries(obj).forEach((el) =>
const datasetData = Object.entries(el[1]);
datasetData.forEach(
(item) =>
datasets = datasets.map((e) =>
if (e.label === item[0])
e.data.push(item[1].median);
return e;
);
);
);
return datasets;
,
javascript callback vue.js
I have a function which returns an array of datasets for a chart written with vue-chartjs. The getter getChartData
returns an array with three objects with nested objects. I see that my function has a so called 'callback hell' and I want to refactor this.
getDatasets()
let datasetLabels = ;
const obj = this.getChartData;
Object.entries(obj).forEach((entry) =>
datasetLabels = [...datasetLabels, ...Object.keys(entry[1])];
);
let datasets = ;
[...new Set(datasetLabels)].forEach((item, index, arr) =>
datasets.push( label: item, backgroundColor: this.getColor(arr, index), data: );
);
Object.entries(obj).forEach((el) =>
const datasetData = Object.entries(el[1]);
datasetData.forEach(
(item) =>
datasets = datasets.map((e) =>
if (e.label === item[0])
e.data.push(item[1].median);
return e;
);
);
);
return datasets;
,
javascript callback vue.js
edited May 22 at 14:10
200_success
123k14143399
123k14143399
asked May 22 at 6:59
Olga B
234
234
2
Welcome to Code Review! The current question title, which states your concerns about the code, is too general to be useful here. Please edit to the site standard, which is for the title to simply state the task accomplished by the code. Please see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
May 22 at 8:23
2
No need to wait until next time - you can still edit to improve your question (but we don't allow you to change the actual code once you've received an answer!).
â Toby Speight
May 22 at 9:08
Already done. :)
â Olga B
May 22 at 9:35
1
Please take note of the link that Toby provided, it states: "Use a title that is catchy, and describes the problem your code solvesUse a title that is catchy, and describes the problem your code solves
" please describe what the code does in your title, not an issue you wish to resolve.
â Malachiâ¦
May 22 at 13:44
add a comment |Â
2
Welcome to Code Review! The current question title, which states your concerns about the code, is too general to be useful here. Please edit to the site standard, which is for the title to simply state the task accomplished by the code. Please see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
May 22 at 8:23
2
No need to wait until next time - you can still edit to improve your question (but we don't allow you to change the actual code once you've received an answer!).
â Toby Speight
May 22 at 9:08
Already done. :)
â Olga B
May 22 at 9:35
1
Please take note of the link that Toby provided, it states: "Use a title that is catchy, and describes the problem your code solvesUse a title that is catchy, and describes the problem your code solves
" please describe what the code does in your title, not an issue you wish to resolve.
â Malachiâ¦
May 22 at 13:44
2
2
Welcome to Code Review! The current question title, which states your concerns about the code, is too general to be useful here. Please edit to the site standard, which is for the title to simply state the task accomplished by the code. Please see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
May 22 at 8:23
Welcome to Code Review! The current question title, which states your concerns about the code, is too general to be useful here. Please edit to the site standard, which is for the title to simply state the task accomplished by the code. Please see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
May 22 at 8:23
2
2
No need to wait until next time - you can still edit to improve your question (but we don't allow you to change the actual code once you've received an answer!).
â Toby Speight
May 22 at 9:08
No need to wait until next time - you can still edit to improve your question (but we don't allow you to change the actual code once you've received an answer!).
â Toby Speight
May 22 at 9:08
Already done. :)
â Olga B
May 22 at 9:35
Already done. :)
â Olga B
May 22 at 9:35
1
1
Please take note of the link that Toby provided, it states: "
Use a title that is catchy, and describes the problem your code solvesUse a title that is catchy, and describes the problem your code solves
" please describe what the code does in your title, not an issue you wish to resolve.â Malachiâ¦
May 22 at 13:44
Please take note of the link that Toby provided, it states: "
Use a title that is catchy, and describes the problem your code solvesUse a title that is catchy, and describes the problem your code solves
" please describe what the code does in your title, not an issue you wish to resolve.â Malachiâ¦
May 22 at 13:44
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
False alarm! No callback hell here.
While this code can certainly be refactored a bit, I fail to see callback hell anywhere around. Callback hell is normally a term applied to the code that is executed asynchronously and with multiple nested callback functions. The nested structure is what causes a few issues:
- cognitive complexity (which leads to bugs and maintenance complication);
- refactoring difficulty;
- more importantly, hard time expressing conditional ("branching") or cyclic ("loops") logic.
A related question on StackOverflow might be helpful (just don't focus on RxJs part of the answer there).
Your code does actively use arrow functions, but it is not equivalent to callback hell. The number one reason is because everything in getDatasets()
is executed synchronously.
Refactoring
Nitpicking
- Small details like line breaks are powerful. Splitting the function into paragraphs with empty line separators helps identifying logical steps you're making in code. It also can work help in extracting sub-functions later, if/when the function becomes too long.
- Naming things: Spelling things out is always better than using names like
el
,e
,arr
. Abbreviated variable names like that suggest that these entities have no reason to exist or are unimportant. Evenitem
is not a good name. Since it denotes a label, call it alabel
. I'm sure you got the idea. - Naming continued: Name your variables consistently. You iterate two times over the same object:
Object.entries(obj).forEach(...)
in one case you call the current entry asentry
, while in the other â justel
. That is confusing. - I like how you lock down the chart data in a locally scoped
obj
variable. Renaming it tochartData
would make it more readable, though. - You could also avoid
let
in a few places and haveconst
instead. For example,reduce(...)
ormap(...)
are in many cases a better alternative tofor (...)
or.forEach(...)
. - Also, be careful when you deal with array deconstruction. While it's readable, it's also very inefficient because it creates a new array by iterating all the elements of the source arrays. It's only fine to use it for pieces of code that are not invoked frequently and/or operate on tiny arrays only.
Applying the suggestions to the code
I could only rewrite the first half of the function. The second half requires a broader context to make a meaningful change to it.
As you can see, I failed to rename e
into something descriptive, because I'm unaware of the models you are using in your application. Hopefully, even this "mechanical" refactoring is able to give you some ideas on how the code can be improved.
getDatasets()
const chartData = this.getChartData;
const datasetLabels = Object.values(chartData);
// `datasets` could be a const, if only it wasn't modified further down the road...
let datasets = [...new Set(datasetLabels)]
.map((label, labelIndex, array) => ( label, backgroundColor: this.getColor(array, labelIndex), data: ));
// This is a subject to a few more changing, maybe...
Object
.entries(chartData)
.forEach((entry) =>
Object.entries(entry[1]).forEach((dataItem) =>
datasets = datasets.map((e) =>
if (e.label === dataItem[0])
e.data.push(dataItem[1].median);
return e;
);
);
);
return datasets;
Update As @Gerrit0 suggested, Object.values(...)
is a better option than Object.entities(...).map(...)
(more concise and achieves exactly the same result).
@OlgaB sure! Glad to help.
â Igor Soloydenko
May 22 at 8:21
1
Given that you never useentry[0]
, it might be worth switching toObject.values
â Gerrit0
May 22 at 11:18
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
False alarm! No callback hell here.
While this code can certainly be refactored a bit, I fail to see callback hell anywhere around. Callback hell is normally a term applied to the code that is executed asynchronously and with multiple nested callback functions. The nested structure is what causes a few issues:
- cognitive complexity (which leads to bugs and maintenance complication);
- refactoring difficulty;
- more importantly, hard time expressing conditional ("branching") or cyclic ("loops") logic.
A related question on StackOverflow might be helpful (just don't focus on RxJs part of the answer there).
Your code does actively use arrow functions, but it is not equivalent to callback hell. The number one reason is because everything in getDatasets()
is executed synchronously.
Refactoring
Nitpicking
- Small details like line breaks are powerful. Splitting the function into paragraphs with empty line separators helps identifying logical steps you're making in code. It also can work help in extracting sub-functions later, if/when the function becomes too long.
- Naming things: Spelling things out is always better than using names like
el
,e
,arr
. Abbreviated variable names like that suggest that these entities have no reason to exist or are unimportant. Evenitem
is not a good name. Since it denotes a label, call it alabel
. I'm sure you got the idea. - Naming continued: Name your variables consistently. You iterate two times over the same object:
Object.entries(obj).forEach(...)
in one case you call the current entry asentry
, while in the other â justel
. That is confusing. - I like how you lock down the chart data in a locally scoped
obj
variable. Renaming it tochartData
would make it more readable, though. - You could also avoid
let
in a few places and haveconst
instead. For example,reduce(...)
ormap(...)
are in many cases a better alternative tofor (...)
or.forEach(...)
. - Also, be careful when you deal with array deconstruction. While it's readable, it's also very inefficient because it creates a new array by iterating all the elements of the source arrays. It's only fine to use it for pieces of code that are not invoked frequently and/or operate on tiny arrays only.
Applying the suggestions to the code
I could only rewrite the first half of the function. The second half requires a broader context to make a meaningful change to it.
As you can see, I failed to rename e
into something descriptive, because I'm unaware of the models you are using in your application. Hopefully, even this "mechanical" refactoring is able to give you some ideas on how the code can be improved.
getDatasets()
const chartData = this.getChartData;
const datasetLabels = Object.values(chartData);
// `datasets` could be a const, if only it wasn't modified further down the road...
let datasets = [...new Set(datasetLabels)]
.map((label, labelIndex, array) => ( label, backgroundColor: this.getColor(array, labelIndex), data: ));
// This is a subject to a few more changing, maybe...
Object
.entries(chartData)
.forEach((entry) =>
Object.entries(entry[1]).forEach((dataItem) =>
datasets = datasets.map((e) =>
if (e.label === dataItem[0])
e.data.push(dataItem[1].median);
return e;
);
);
);
return datasets;
Update As @Gerrit0 suggested, Object.values(...)
is a better option than Object.entities(...).map(...)
(more concise and achieves exactly the same result).
@OlgaB sure! Glad to help.
â Igor Soloydenko
May 22 at 8:21
1
Given that you never useentry[0]
, it might be worth switching toObject.values
â Gerrit0
May 22 at 11:18
add a comment |Â
up vote
5
down vote
accepted
False alarm! No callback hell here.
While this code can certainly be refactored a bit, I fail to see callback hell anywhere around. Callback hell is normally a term applied to the code that is executed asynchronously and with multiple nested callback functions. The nested structure is what causes a few issues:
- cognitive complexity (which leads to bugs and maintenance complication);
- refactoring difficulty;
- more importantly, hard time expressing conditional ("branching") or cyclic ("loops") logic.
A related question on StackOverflow might be helpful (just don't focus on RxJs part of the answer there).
Your code does actively use arrow functions, but it is not equivalent to callback hell. The number one reason is because everything in getDatasets()
is executed synchronously.
Refactoring
Nitpicking
- Small details like line breaks are powerful. Splitting the function into paragraphs with empty line separators helps identifying logical steps you're making in code. It also can work help in extracting sub-functions later, if/when the function becomes too long.
- Naming things: Spelling things out is always better than using names like
el
,e
,arr
. Abbreviated variable names like that suggest that these entities have no reason to exist or are unimportant. Evenitem
is not a good name. Since it denotes a label, call it alabel
. I'm sure you got the idea. - Naming continued: Name your variables consistently. You iterate two times over the same object:
Object.entries(obj).forEach(...)
in one case you call the current entry asentry
, while in the other â justel
. That is confusing. - I like how you lock down the chart data in a locally scoped
obj
variable. Renaming it tochartData
would make it more readable, though. - You could also avoid
let
in a few places and haveconst
instead. For example,reduce(...)
ormap(...)
are in many cases a better alternative tofor (...)
or.forEach(...)
. - Also, be careful when you deal with array deconstruction. While it's readable, it's also very inefficient because it creates a new array by iterating all the elements of the source arrays. It's only fine to use it for pieces of code that are not invoked frequently and/or operate on tiny arrays only.
Applying the suggestions to the code
I could only rewrite the first half of the function. The second half requires a broader context to make a meaningful change to it.
As you can see, I failed to rename e
into something descriptive, because I'm unaware of the models you are using in your application. Hopefully, even this "mechanical" refactoring is able to give you some ideas on how the code can be improved.
getDatasets()
const chartData = this.getChartData;
const datasetLabels = Object.values(chartData);
// `datasets` could be a const, if only it wasn't modified further down the road...
let datasets = [...new Set(datasetLabels)]
.map((label, labelIndex, array) => ( label, backgroundColor: this.getColor(array, labelIndex), data: ));
// This is a subject to a few more changing, maybe...
Object
.entries(chartData)
.forEach((entry) =>
Object.entries(entry[1]).forEach((dataItem) =>
datasets = datasets.map((e) =>
if (e.label === dataItem[0])
e.data.push(dataItem[1].median);
return e;
);
);
);
return datasets;
Update As @Gerrit0 suggested, Object.values(...)
is a better option than Object.entities(...).map(...)
(more concise and achieves exactly the same result).
@OlgaB sure! Glad to help.
â Igor Soloydenko
May 22 at 8:21
1
Given that you never useentry[0]
, it might be worth switching toObject.values
â Gerrit0
May 22 at 11:18
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
False alarm! No callback hell here.
While this code can certainly be refactored a bit, I fail to see callback hell anywhere around. Callback hell is normally a term applied to the code that is executed asynchronously and with multiple nested callback functions. The nested structure is what causes a few issues:
- cognitive complexity (which leads to bugs and maintenance complication);
- refactoring difficulty;
- more importantly, hard time expressing conditional ("branching") or cyclic ("loops") logic.
A related question on StackOverflow might be helpful (just don't focus on RxJs part of the answer there).
Your code does actively use arrow functions, but it is not equivalent to callback hell. The number one reason is because everything in getDatasets()
is executed synchronously.
Refactoring
Nitpicking
- Small details like line breaks are powerful. Splitting the function into paragraphs with empty line separators helps identifying logical steps you're making in code. It also can work help in extracting sub-functions later, if/when the function becomes too long.
- Naming things: Spelling things out is always better than using names like
el
,e
,arr
. Abbreviated variable names like that suggest that these entities have no reason to exist or are unimportant. Evenitem
is not a good name. Since it denotes a label, call it alabel
. I'm sure you got the idea. - Naming continued: Name your variables consistently. You iterate two times over the same object:
Object.entries(obj).forEach(...)
in one case you call the current entry asentry
, while in the other â justel
. That is confusing. - I like how you lock down the chart data in a locally scoped
obj
variable. Renaming it tochartData
would make it more readable, though. - You could also avoid
let
in a few places and haveconst
instead. For example,reduce(...)
ormap(...)
are in many cases a better alternative tofor (...)
or.forEach(...)
. - Also, be careful when you deal with array deconstruction. While it's readable, it's also very inefficient because it creates a new array by iterating all the elements of the source arrays. It's only fine to use it for pieces of code that are not invoked frequently and/or operate on tiny arrays only.
Applying the suggestions to the code
I could only rewrite the first half of the function. The second half requires a broader context to make a meaningful change to it.
As you can see, I failed to rename e
into something descriptive, because I'm unaware of the models you are using in your application. Hopefully, even this "mechanical" refactoring is able to give you some ideas on how the code can be improved.
getDatasets()
const chartData = this.getChartData;
const datasetLabels = Object.values(chartData);
// `datasets` could be a const, if only it wasn't modified further down the road...
let datasets = [...new Set(datasetLabels)]
.map((label, labelIndex, array) => ( label, backgroundColor: this.getColor(array, labelIndex), data: ));
// This is a subject to a few more changing, maybe...
Object
.entries(chartData)
.forEach((entry) =>
Object.entries(entry[1]).forEach((dataItem) =>
datasets = datasets.map((e) =>
if (e.label === dataItem[0])
e.data.push(dataItem[1].median);
return e;
);
);
);
return datasets;
Update As @Gerrit0 suggested, Object.values(...)
is a better option than Object.entities(...).map(...)
(more concise and achieves exactly the same result).
False alarm! No callback hell here.
While this code can certainly be refactored a bit, I fail to see callback hell anywhere around. Callback hell is normally a term applied to the code that is executed asynchronously and with multiple nested callback functions. The nested structure is what causes a few issues:
- cognitive complexity (which leads to bugs and maintenance complication);
- refactoring difficulty;
- more importantly, hard time expressing conditional ("branching") or cyclic ("loops") logic.
A related question on StackOverflow might be helpful (just don't focus on RxJs part of the answer there).
Your code does actively use arrow functions, but it is not equivalent to callback hell. The number one reason is because everything in getDatasets()
is executed synchronously.
Refactoring
Nitpicking
- Small details like line breaks are powerful. Splitting the function into paragraphs with empty line separators helps identifying logical steps you're making in code. It also can work help in extracting sub-functions later, if/when the function becomes too long.
- Naming things: Spelling things out is always better than using names like
el
,e
,arr
. Abbreviated variable names like that suggest that these entities have no reason to exist or are unimportant. Evenitem
is not a good name. Since it denotes a label, call it alabel
. I'm sure you got the idea. - Naming continued: Name your variables consistently. You iterate two times over the same object:
Object.entries(obj).forEach(...)
in one case you call the current entry asentry
, while in the other â justel
. That is confusing. - I like how you lock down the chart data in a locally scoped
obj
variable. Renaming it tochartData
would make it more readable, though. - You could also avoid
let
in a few places and haveconst
instead. For example,reduce(...)
ormap(...)
are in many cases a better alternative tofor (...)
or.forEach(...)
. - Also, be careful when you deal with array deconstruction. While it's readable, it's also very inefficient because it creates a new array by iterating all the elements of the source arrays. It's only fine to use it for pieces of code that are not invoked frequently and/or operate on tiny arrays only.
Applying the suggestions to the code
I could only rewrite the first half of the function. The second half requires a broader context to make a meaningful change to it.
As you can see, I failed to rename e
into something descriptive, because I'm unaware of the models you are using in your application. Hopefully, even this "mechanical" refactoring is able to give you some ideas on how the code can be improved.
getDatasets()
const chartData = this.getChartData;
const datasetLabels = Object.values(chartData);
// `datasets` could be a const, if only it wasn't modified further down the road...
let datasets = [...new Set(datasetLabels)]
.map((label, labelIndex, array) => ( label, backgroundColor: this.getColor(array, labelIndex), data: ));
// This is a subject to a few more changing, maybe...
Object
.entries(chartData)
.forEach((entry) =>
Object.entries(entry[1]).forEach((dataItem) =>
datasets = datasets.map((e) =>
if (e.label === dataItem[0])
e.data.push(dataItem[1].median);
return e;
);
);
);
return datasets;
Update As @Gerrit0 suggested, Object.values(...)
is a better option than Object.entities(...).map(...)
(more concise and achieves exactly the same result).
edited May 22 at 18:39
answered May 22 at 7:52
Igor Soloydenko
2,697827
2,697827
@OlgaB sure! Glad to help.
â Igor Soloydenko
May 22 at 8:21
1
Given that you never useentry[0]
, it might be worth switching toObject.values
â Gerrit0
May 22 at 11:18
add a comment |Â
@OlgaB sure! Glad to help.
â Igor Soloydenko
May 22 at 8:21
1
Given that you never useentry[0]
, it might be worth switching toObject.values
â Gerrit0
May 22 at 11:18
@OlgaB sure! Glad to help.
â Igor Soloydenko
May 22 at 8:21
@OlgaB sure! Glad to help.
â Igor Soloydenko
May 22 at 8:21
1
1
Given that you never use
entry[0]
, it might be worth switching to Object.values
â Gerrit0
May 22 at 11:18
Given that you never use
entry[0]
, it might be worth switching to Object.values
â Gerrit0
May 22 at 11:18
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f194925%2fextracting-data-from-vue-chartjs-into-an-array-of-datasets%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
Welcome to Code Review! The current question title, which states your concerns about the code, is too general to be useful here. Please edit to the site standard, which is for the title to simply state the task accomplished by the code. Please see How to get the best value out of Code Review: Asking Questions for guidance on writing good question titles.
â Toby Speight
May 22 at 8:23
2
No need to wait until next time - you can still edit to improve your question (but we don't allow you to change the actual code once you've received an answer!).
â Toby Speight
May 22 at 9:08
Already done. :)
â Olga B
May 22 at 9:35
1
Please take note of the link that Toby provided, it states: "
Use a title that is catchy, and describes the problem your code solvesUse a title that is catchy, and describes the problem your code solves
" please describe what the code does in your title, not an issue you wish to resolve.â Malachiâ¦
May 22 at 13:44