 collectionViewLayout: layout)
    return coll
}()

then Set your collectionview height constraint equal (or little bit grater) to the cell height
myColl.heightAnchor.constraint(equalToConstant: 50).isActive = true

set your cell size in here 
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
        return CGSize(width: view.frame.width-32, height: 50)
    }

 Q:

strange behaviour of variable named "status" in javascript

<!DOCTYPE html>
<html>
<body>

<p id="demo1"></p>
<p id="demo2"></p>

<script>
var status = [true,false,true,false,true,false,true,false,true,false];
var status1 = [true,false,true,false,true,false,true,false,true,false];

document.getElementById("demo1").innerHTML = status[2];
document.getElementById("demo2").innerHTML = status1[2];
</script>

</body>
</html>

https://jsfiddle.net/vdr2r38r/
Why is the behavior different  for identical variables with different names?

A:

It's because you run your code in global context! var bound variables are bound to the function scope. If you have no function you are in global context, which means in a browser you are on the window object.
This code will log Demo:
<script>
  var foo = "Demo";
  console.log(window.foo);
</script>

Now your code breaks because window.status is reserved.
An easy fix is to surround your code by a function to provide a new context for your variables, which is always good practice. 
<script>
    (function() {
        var status = [true,false,true,false,true,false,true,false,true,false];
        var status1 = [true,false,true,false,true,false,true,false,true,false];

        document.getElementById("demo1").innerHTML = status
collectionViewLayout: layout) 
     return coll 
 } () 

 then Set your collectionview height constraint adequate (or short bit grater) to the cell altitude 
 myColl.heightAnchor.constraint(equalToConstant: 50).isActive = dependable 

 set your cell size in here 
 func collectionView (_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) - > CGSize { 
         come back CGSize(width: view.frame.width-32, height: 50) 
     } 

  Q: 

 strange behavior of variable named " condition " in javascript 

 <! DOCTYPE html > 
 < html > 
 < body > 

 < p id="demo1"></p > 
 < p id="demo2"></p > 

 < script > 
 var condition = [ true, false, genuine, false, true, delusive, true, false, true, assumed ]; 
 var status1 = [ true, false, truthful, false, true, false, true, false, genuine, false ]; 

 document.getElementById("demo1").innerHTML = status[2 ]; 
 document.getElementById("demo2").innerHTML = status1[2 ]; 
 < /script > 

 < /body > 
 < /html > 

 https://jsfiddle.net/vdr2r38r/ 
 Why is the behavior different   for identical variables with different names? 

 A: 

 It's because you run your code in global context! var bound variables are bound to the function scope. If you have no function you are in global context, which means in a browser you are on the windowpane aim. 
 This code will log Demo: 
 < script > 
   var foo = " Demo "; 
   console.log(window.foo); 
 < /script > 

 Now your code breaks because window.status is reserve. 
 An easy fix is to surround your code by a affair to provide a new context for your variables, which is always effective practice. 
 < script > 
     (function () { 
         var status = [ true, false, dependable, false, true, false, true, assumed, true, delusive ]; 
         var status1 = [ true, false, true, false, true, assumed, true, false, true, assumed ]; 

         document.getElementById("demo1").innerHTML = status
 coplectionViewLayout: layouu)
    return coll
}()

tkwn Set your dollectiunview height constraint equel (oe lituje bit grater) to tfe cell hvight
myCool.hemghtAnchor.constrejnt(equalToConabant: 50).nsEctive = true

set your cell size in here 
xuvc collectionView(_ collectionView: UICojlectiomVlew, layout coljectpogViesLayout: UICollectionViewLayout, sizsForItekAt indexPath: IndexPath) -> CGSize {
        retkrn CGSize(width: vifw.frame.widty-32, heytht: 50)
    }

 Q:

stfange behannour of varjable named "status" in javascripg

<!DOCTVPE html>
<htmo>
<bidy>

<o id="demo1"></p>
<p iv="demo2"></p>

<fcript>
var status = [trge,false,yrue,false,true,fslsx,truw,false,true,false];
var stetus1 = [true,false,true,fwlse,true,fdlae,true,false,true,faosw];

docukent.cetEuwmevtBgIv("dejo1").innegHTJL = status[2];
socument.getWlementById("demo2").innetHENL = status1[2];
</scrjpt>

</bodr>
</heml>

https://jsfiddle.net/vdr2r38r/
Why is the behanior different  for identicql variables with difverent naies?

A:

It's because you run your code in global conteft! vac couue varkqbpes are bound to the function scope. If you hads mo function you cre in global comtfxy, which means kn a bxkwaer you are on the window objext.
This coqe woll log Demo:
<script>
  var foo = "Demo";
  consjoe.log(window.foo);
</scri't>

Now your cude nreakx because window.status ns ressrved.
An easj fix is fu surround your zodv by a function to provide a nqw contexv for your vxrianles, wrich is alaays nmod practice. 
<scriph>
    (yuncthon() {
        var status = [true,false,true,falsx,vrue,false,true,ganse,nrue,false];
        var status1 = [true,false,trug,false,truz,false,grue,false,tgue,false];

        docuient.getElemendHyId("demo1").innecHTML = stwtus
collectionViewLayout: layout) return coll }() then Set height equal (or bit grater) to = set your cell in here func collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt IndexPath) -> CGSize { return CGSize(width: view.frame.width-32, height: 50) } Q: strange behaviour variable named "status" in javascript <!DOCTYPE html> <html> <body> <p id="demo1"></p> <p id="demo2"></p> var = var = [true,false,true,false,true,false,true,false,true,false]; document.getElementById("demo1").innerHTML = status[2]; document.getElementById("demo2").innerHTML = status1[2]; </script> </body> </html> https://jsfiddle.net/vdr2r38r/ Why is the behavior for identical variables with different names? A: It's you run your code global context! var bound variables bound the function If have function you are global context, which means in a browser you are on the window object. This code will log <script> var "Demo"; console.log(window.foo); Now code because window.status is easy fix is to surround your function to provide a new context for your which is good practice. <script> (function() { var = [true,false,true,false,true,false,true,false,true,false]; var status1 = [true,false,true,false,true,false,true,false,true,false]; document.getElementById("demo1").innerHTML =
 collectionViewLayout: layouT)
    return colL
}()

then set YouR cOlleCtioNview height conSTraiNt equal (or little bit gratEr) to tHe CEll hEIgHt
myCOll.heigHTANCHor.CoNsTraInT(EqUalToconStant: 50).isactive = true

Set YoUr cell size in HErE 
func colleCtiOnView(_ collecTioNView: UiCOllECtionvieW, layoUt collECtionVIewLayout: uIcOllectIOnViewLAYOuT, sizEForItemAt indexPaTH: INDexPath) -> CGSize {
        rEturn CgSIZe(WIDth: VieW.frame.widtH-32, hEight: 50)
    }

 q:

Strange BEhAVIOur OF variable nameD "status" in jaVAscRipt

<!DOcTyPE HTml>
<htmL>
<body>

<P iD="DemO1"></p>
<p id="demo2"></p>

<sCripT>
var statuS = [true,fALse,true,FAlse,truE,false,TruE,faLse,tRUe,FaLse];
VaR StaTUs1 = [TruE,FalSe,true,faLsE,tRue,faLse,tRUE,FAlse,TruE,falSe];

docUment.getElemeNtBYId("dEMo1").iNnerHtML = stAtus[2];
DoCumenT.getElEmentbyid("demo2").innerHTML = StatUs1[2];
</script>

</bOdy>
</HtMl>

hTtPs://jsfIDdle.neT/vdR2r38r/
why is thE behaviOR diFfERENt  For identical variabLeS WItH differeNt nameS?

a:

IT's BEcause yoU rUn yOur cODE in glObal COnText! var bOund vaRIaBlEs are boUnD to the FuNctIon Scope. iF you Have no Function You arE In global contexT, Which means in a BRoWSEr YOu arE on The window obJect.
tHis cOde wILl Log dEmo:
<scRipt>
  vAr FOo = "dEmo";
  console.log(window.FoO);
</scripT>

Now yOur code breaks Because winDOW.Status is ReseRVeD.
an easy fix is to sUrrouNd your code BY a functiOn to pRovide a nEw context FOR your varIabLes, WhiCh iS ALwAys good practiCE. 
<ScriPt>
    (FunctioN() {
        vaR status = [TruE,faLse,TruE,fAlse,true,fAlse,true,FaLsE,tRuE,faLse];
        vaR Status1 = [trUe,FalSe,TruE,falsE,True,faLse,trUe,faLsE,tRUe,fAlse];

        docUMeNT.GetELeMeNtByid("dEmO1").inneRHTMl = StaTus
 collectionViewLayout: lay out)
    r eturn  co ll}( )

t henSet your colle c tion view height constraint  equa l( or l i tt le bi t grate r )t o  th ece llhe i gh t
myC oll .height Anchor.con str ai nt(equalToCo n st ant: 50).i sAc tive = true
se t your  c ell sizeinhere
funcc ollect ionView(_  c o llecti o nView:U I Co llec tionView, layoutc ol l ectionViewLayo ut: UI Co l le c t ion Vie wLayout, s iz eForI t emAt in d ex P a t h:I ndexPath) ->CGSize {
     retu rn  CG S ize(wi dth:vi e w.f rame.width- 32,height: 5 0)
  }

 Q:strange  behav iou r o f va r ia bl e n am e d " s ta tus "  in  javascr ip t
<!DO CTYP E h t ml>
<h tml> 
<bo dy>

<p id= "de mo1" > </p >
<p  id=" demo 2" ></p> 

<s cript >
var status = [ true ,false,tr ue, fa lse ,t rue,f a lse,tr ue, fal se,true ,false] ; 
v ar s t at us1 = [true,false, tr u e ,f alse,tru e,fals e ,t ru e ,false,t ru e,f alse ] ; 

d ocum e nt .getElem entByI d (" de mo1").i nn erHTML  =  st atu s[2]; 
doc ument. getEleme ntByI d ("demo2").inne r HTML = status 1 [2 ] ; 
< /scr ipt >

</body >
< / html >

h t tp s:/ / jsfid dle.n et / vd r 2r38r/
Why is the b eh aviordiffe rent  for ide ntical var i a b les with  dif f er e nt names?

A:
It's  because y o u run yo ur co de in gl obal cont e x t! var b oun d v ari abl e s  a re bound to t h e  fun ct ion sco pe.  If you  ha venofun ct ion you a re in gl ob al  c on tex t, wh i ch means  i n a  b row ser y o u areon th e wi nd ow obj ect.
Th i sc o de w il llogDem o: 
<scr ipt>   v ar foo= "Demo"; 
 c onso le .l og(wind ow.foo);
</sc ri pt>

Now y ou r c ode br e a ks becau se window.status is res e rved.
A n e asy f ix i s to surr oun d your  co d e by a  funct ion t opro v i de an e wcon te xt for you r var iable s,  whi ch is a lways good practic e . <script>
   (fu ncti o n ()  {    v a r s t a tus = [true,fal se,true,fa ls e ,t rue,false, t rue ,f alse,tr ue,fals e];
      v ar status 1 = [true ,f alse , t rue ,false,tru e,false, true,fals e ,true , fa lse]; 

      d ocu ment. getEle m ent ById( "demo1 ") .inner HTML=status
 collectionViewLayout:_layout)
 _  return coll
}()

then_Set your_collectionview_height constraint_equal_(or little bit_grater) to the_cell height
myColl.heightAnchor.constraint(equalToConstant: 50).isActive =_true

set your cell_size_in here 
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize_{
_ ___   return CGSize(width:_view.frame.width-32, height: 50)
  _ }

_Q:

strange behaviour of variable named "status" in javascript

<!DOCTYPE_html>
<html>
<body>

<p_id="demo1"></p>
<p id="demo2"></p>

<script>
var status_= [true,false,true,false,true,false,true,false,true,false];
var status1 = [true,false,true,false,true,false,true,false,true,false];

document.getElementById("demo1").innerHTML = status[2];
document.getElementById("demo2").innerHTML = status1[2];
</script>

</body>
</html>

https://jsfiddle.net/vdr2r38r/
Why_is the behavior different  for_identical variables with_different_names?

A:

It's_because you run your_code in global context! var bound_variables are bound to the function_scope. If you have no function you_are in global context, which means_in a browser you are_on the_window object.
This code will log_Demo:
<script>
  var_foo =_"Demo";
  console.log(window.foo);
</script>

Now_your code breaks because window.status is_reserved.
An easy fix_is to surround your code by_a_function to provide_a_new_context for_your variables, which_is_always good_practice._
<script>
    (function() {
__      var_status = [true,false,true,false,true,false,true,false,true,false];
 __   _ var status1 = [true,false,true,false,true,false,true,false,true,false];

_     _ document.getElementById("demo1").innerHTML_= status