Convert Javascript to TypeScript
- or -
Post a project like this1079
£25(approx. $31)
- Posted:
- Proposals: 1
- Remote
- #3244435
- Awarded
Description
Experience Level: Entry
Hi,
I would like someone to convert these few lines of javascript code, to TypeScript:
function dynamicSort(property) {
var sortOrder = 1;
if(property[0] === "-") {
sortOrder = -1;
property = property.substr(1);
}
return function (a,b) {
var result = (a[property] b[property]) ? 1 : 0;
return result * sortOrder;
}
}
This is from:
https://stackoverflow.com/questions/1129216/sort-array-of-objects-by-string-property-value
For someone that knows what they are doing, this should only take a few mins.
I would like someone to convert these few lines of javascript code, to TypeScript:
function dynamicSort(property) {
var sortOrder = 1;
if(property[0] === "-") {
sortOrder = -1;
property = property.substr(1);
}
return function (a,b) {
var result = (a[property] b[property]) ? 1 : 0;
return result * sortOrder;
}
}
This is from:
https://stackoverflow.com/questions/1129216/sort-array-of-objects-by-string-property-value
For someone that knows what they are doing, this should only take a few mins.
Paul M.
100% (28)Projects Completed
27
Freelancers worked with
26
Projects awarded
53%
Last project
6 Jul 2022
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies