text: Q:
  
  using string trim and toLowerCase methods in a single array map method not works as expected
  
  I have a string that I want to do a process to it:
  1) split it by '.' and make an array
  2) make each word and character to lower case 
  3) trim the array elements
  I know that we can do this by coding each step separately but I want to do this in one line.
  But it confused me why I can't do this using map(s => s.toLowerCase() && s.trim()) only the last method in the map works?
  Any suggestions would be greatly appreciated.
  
  let trapSt = '  I Was Sent = I Sent. To Earth = To Moon     '
  trapSt = trapSt.split(".")
  only_LowerCase_Works_Here = trapSt.map(s => s.trim() && s.toLowerCase()); // ??? why only s.toLowerCase() works here???!!!!
  only_Trim_Works_Here = trapSt.map(s => s.toLowerCase() && s.trim()); // ??? why only s.trim() works here???!!!!
  
  console.log(only_LowerCase_Works_Here); 
  console.log(only_Trim_Works_Here); 
  
  A:
  
  Because toLowerCase and trim don't modify the string in place, they return the string after the modification. 
  The && isn't the same as:
  s.toLowerCase().trim()
  
  which is what you want.
  Try this:
  let trapSt = '  I Was Sent = I Sent. To Earth = To Moon     '
  trapSt = trapSt.split(".")
  only_LowerCase_Works_Here = trapSt.map(s => s.trim() && s.toLowerCase()); // ??? why only s.toLowerCase() works here???!!!!
  only_Trim_Works_Here = trapSt.map(s => s.toLowerCase().trim()); // ??? why only s.trim() works here???!!!!
  
  console.log(only_LowerCase_Works_Here); 
  console.log(only_Trim_Works_Here); 
  
  