Author: Ryan Tate

Partition an Array in Javascript

At times it’s necessary to partition an array in to equal size chunks. This is a simple JS one-liner that makes it really easy to do.   Array(Math.ceil(a.length / size)).fill(0).map((_,i) => a.slice(i * size, (i+1) * size));   Example Usage:   const a = [1,2,3,4,5,6,7,8,9]; function partition(a,size){ return Array(Math.ceil(a.length / size)).fill(0).map((_,i) => a.slice(i * size, (i+1) * size)); } Array(9).fill(0).map((_,i)… Read more →

Sharepoint 2013 Assigned to Field Showing HTML Code

I came across this issue today at work. I found multiple blog posts detailing the issue including this one and this other but unfortunately the code mentioned in both places threw an error in SharePoint 2013. Both recommend adding display-output-escaping=”yes” to the field in SP Designer: <xsl:value-of select="@VariableName" display-output-escaping="yes"></xsl:value-of> It turns out that in SharePoint 2013 that fails with the… Read more →