ejs template function inside function

Is there a way for ejs template to call a function inside another function? For example I am trying to do like this:

<% function graph(graph) { %>
        <a href="<%= graph.href %>"><%= graph.description %></a>
<% } %>


<% function point(point) { %>

    <Placemark id="<%= point.id %>">
        <description>
        <%= point.Apibudinimas %> <%= point.IP %>
        <![CDATA[

        <% graphs.map(graph) %>

        ]]>
        </description>
    </Placemark>

<% } %>

But it says that graphs are undefined...

Your code is saying that "graphs" (with an "s") is undefined and not "graph", correct? Where are you defining the graphs array? Otherwise, the code looks fine.