Click here to Skip to main content
15,507,755 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionIs there a way to input a unique number for each array output? Pin
machinewraith31-Aug-22 16:46
machinewraith31-Aug-22 16:46 
AnswerRe: Is there a way to input a unique number for each array output? Pin
Richard Deeming1-Sep-22 23:23
mveRichard Deeming1-Sep-22 23:23 
Questionjavascript looping pattern question Pin
ravindra Yadav 202213-Aug-22 2:22
ravindra Yadav 202213-Aug-22 2:22 
AnswerRe: javascript looping pattern question Pin
Richard MacCutchan13-Aug-22 2:31
mveRichard MacCutchan13-Aug-22 2:31 
QuestionJavascript Pin
User 1567076229-Jul-22 1:20
User 1567076229-Jul-22 1:20 
AnswerRe: Javascript Fibonacci sequence Pin
Richard MacCutchan29-Jul-22 4:28
mveRichard MacCutchan29-Jul-22 4:28 
RantRe: Javascript Pin
Richard Deeming1-Aug-22 1:29
mveRichard Deeming1-Aug-22 1:29 
QuestionI need help in defining and calling Static variable in Typescript. Pin
Afi_sh26-Jul-22 6:01
Afi_sh26-Jul-22 6:01 
export class myClass implements OnInit {

counter=0;
static counter:any;

onListItemClick(PackDef: PackDefinition): void {
this.itemClicked.emit(PackDef);
this.counter++;
console.log(this.counter);


and

<pre>import { myClass } from '../../../';
dialogRef.afterClosed().subscribe((result: any) => {
this.saveMyMethod();
console.log("Final1"),
console.log(myClass.counter);
});

saveMyMethod(): void {
console.log("Final2"),
console.log(myClass.counter);


Do you know why I cant have correct counter after "Final1" or "Final2"? but I have a correct counter in myClass.


modified 26-Jul-22 12:58pm.

AnswerRe: I need help in defining and calling Static variable in Typescript. Pin
Jeremy Falcon26-Oct-22 12:41
professionalJeremy Falcon26-Oct-22 12:41 
QuestionNew to Coding Pin
John Wiser25-Jul-22 4:05
John Wiser25-Jul-22 4:05 
AnswerRe: New to Coding Pin
Richard MacCutchan25-Jul-22 4:10
mveRichard MacCutchan25-Jul-22 4:10 
GeneralRe: New to Coding Pin
John Wiser25-Jul-22 10:44
John Wiser25-Jul-22 10:44 
AnswerRe: New to Coding Pin
Jeremy Falcon26-Oct-22 12:49
professionalJeremy Falcon26-Oct-22 12:49 
QuestionI need help with a task Pin
User 1567076221-Jul-22 12:35
User 1567076221-Jul-22 12:35 
AnswerRe: I need help with a task Pin
jeron121-Jul-22 12:56
jeron121-Jul-22 12:56 
GeneralRe: I need help with a task Pin
jsc4225-Jul-22 5:11
professionaljsc4225-Jul-22 5:11 
QuestionI need help with an Javascript exercise! Pin
User 1567076215-Jul-22 21:39
User 1567076215-Jul-22 21:39 
GeneralRe: I need help with an Javascript exercise! Pin
Richard MacCutchan15-Jul-22 22:29
mveRichard MacCutchan15-Jul-22 22:29 
GeneralRe: I need help with an Javascript exercise! Pin
User 1567076215-Jul-22 23:59
User 1567076215-Jul-22 23:59 
GeneralRe: I need help with an Javascript exercise! Pin
Richard MacCutchan16-Jul-22 0:09
mveRichard MacCutchan16-Jul-22 0:09 
GeneralRe: I need help with an Javascript exercise! Pin
Eddy Vluggen16-Jul-22 4:53
professionalEddy Vluggen16-Jul-22 4:53 
GeneralRe: I need help with an Javascript exercise! Pin
Richard MacCutchan16-Jul-22 5:18
mveRichard MacCutchan16-Jul-22 5:18 
GeneralRe: I need help with an Javascript exercise! Pin
Eddy Vluggen16-Jul-22 5:46
professionalEddy Vluggen16-Jul-22 5:46 
GeneralRe: I need help with an Javascript exercise! Pin
Richard MacCutchan16-Jul-22 5:51
mveRichard MacCutchan16-Jul-22 5:51 
GeneralRe: I need help with an Javascript exercise! Pin
Eddy Vluggen16-Jul-22 6:00
professionalEddy Vluggen16-Jul-22 6:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.