‘’’
const MYCONCAT = (arr1, arr2) => {
“use strict”;
return arr1.concat(arr2);
};
// OR
const MY_CONCAT = (arr1, arr2) => {
“use strict”;
return arr1.concat(arr2);
};
‘’’
const MYCONCAT = (arr1, arr2) => {
“use strict”;
return arr1.concat(arr2);
};
// OR
const MY_CONCAT = (arr1, arr2) => {
“use strict”;
return arr1.concat(arr2);
};
By standard convention, it would be
const myConcat = (arr1, arr2) => {
Just because you’ve decided to use a function expression instead of the function keyword doesn’t make the name of the function not the name of function.
Also you need to underscores for readability reasons, it’s not practical to use anything else:
THISISASENTENCEINWHICHALLTHECHARACTERSAREUPPERCASE
vs
THIS_IS_A_SENTENCE_IN_WHICH_ALL_THE_CHARACTERS_ARE_UPPERCASE
Given that best practise is to use const
for as much as possible in JavaScript, CAPITALIZING EVERY const means THAT your code IS going to READ LIKE this WHICH is very DIFFICULT FOR a HUMAN READER to PARSE. If you capitalize all consts, your code will be borderline unreadable.
Languages which use SCREAMING_CAPITALS for consts tend to use them for actual constant values. Convention in JS tends to be the same, constant values just aren’t terribly common. By actual constant values, I mean PI or E or the speed of light in a vacuum, or the value you’re going to set as gravity in your game world or whatever. Values that do not ever change, anywhere.