SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: Loop

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2014
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Loop

    Hi,

    Please help me in below code, I need "optionCount" should repeat "x" times



    Code:
    var participants= [];
    
                for (var j= 1; j<= k;  j++) {
                    
                    var option= [];
    
                   for (x = 1; x <= i; x++) {
    
                       
                        option.push(x);
    
    
                        // alert(x);
    
                    };
    
                        participants.push({
                        NoPrticiField: NoPrticiField,
                        empname: ko.observable(),
                        designation: ko.observable(),
                        email: ko.observable(),
                        optionCount: option,
    
                     // I need "optionCount" should repeat "x" times
                        
                    });
                   
                }
    Last edited by Pullo; Mar 4, 2014 at 05:51.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •