Home / CSE / Javascript - CS :: Discussion

Discussion :: Javascript - CS

  1. What is the code to be used to trim whitespaces ?

  2. A.

     let trimmed = (l.trim() for (l in lines));

    B.

     let trimmed = (trim(l));

    C.

     let trimmed = l.trim();

    D.

     let trimmed = for(l in lines));

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    We can use the above code to trim whitespaces and filter out comments and blank lines.


Be The First To Comment