47 let expiresStr = "";
48 if(expires === "") {
49 expiresStr = ";expires=";
50 const d = new Date();51 d.setTime(d.getTime() + YEAR_IN_MS);
52 expiresStr += d.toUTCString();
53 }
43 const val = ta.value;
44 const ss = ta.selectionStart;
45 const se = ta.selectionEnd;
46 const r = se + 2 + tag.length;47 ta.value = val.slice(0, ss) +
48 `[${tag}]` +
49 val.slice(ss, se) +
52 submitted = true;
53 return false;
54 });
55 const e = $.Event("keydown");56 e.ctrlKey = true;
57 e.keyCode = 10;
58 $form.find("textarea#postmsg").first().trigger(e);
12function doBBCode(keycode: number, text: string, start: number, end: number) {
13 const $ta = $<HTMLTextAreaElement>("<textarea/>");
14 $ta.text(text);
15 const e = $.Event("keydown");16 e.ctrlKey = true;
17 $ta[0].selectionStart = start;
18 $ta[0].selectionEnd = end;
Single character variable names affect code readability and complicate code refactoring, because of the difficulty in searching and replacing single characters.
This issue will not be raised for certain special identifiers, such as i
, j
or n
. It will also not be reported for the parameters used in for
and while
loops.
var a;
const l = 90
var age;
const limit = 90;
for(let o = 2; o < 10; o++){
sum += o
}