CAML query logic

When I extract data from a list and want to filter them, I use

"intraActive eq 1 and StartDate lt datetime'" + new Date().toISOString() + "' and OData__EndDate ge datetime'" + new Date().toISOString() + "'"; 

Full code:

   var promise = web.getList(listUrl).items;      if (filter) {         promise = promise.filter(filter); //Filter is the code snippet above     } 

I now want to use CAML to do the same thing

 "<View><Query></Query></View>"; 

However, I have no clue about CAML. Any help?