I am working on a web application and I come to this calculation method that is going to take a string and returns the number of SMS messages.(It's a pure function and doesn't need any external resources to do its job)
I need this function to work both in client-side and server-side.While in client-side user can see the number of SMSs of his message so far and when in server-side i have to calculate how much does the message cost.
I thought that I had to have a C# version of this function for server-side and a javascript one for client-side but then I thought DRY - what if I could run javascript functions in server-side too ? I am not sure if it's possible or not ?
So here's the question : can we run a javascript function in server-side (or in my case from a class library)?