Sections
Simply Fly is a client side javascript library based on jQuery for manipulating DOM elements, array and strings.
Simply Fly is dependent on jQuery, so first add jQuery to your page-
or the minified version-
What can Simply Fly do for you? Here is the complete documentation.
DOM Methods
All the DOM methods return the jQuery object so that the methods can be chained
class="myDiv"
Student | Department | University |
---|
Hello world
Student | Department | University |
---|
Student | Department | University |
---|
Student | Department | University |
---|
Are you sure?
Yes
No
Do you want to save your data?
Ok
Cancel
Shows the following..
Student | Department | University |
---|
Student | Department | University |
---|
Array Methods
var numberArray = [ 5, 4, 1, 2, 9, 8, 7, 4, 1, 210, 25 ];
var sum = numberArray.getSum(); /* returns 276*/
var average= numberArray.getAverage(); /* returns 25.0909...*/
var numberArray = [ 5, 4, 1, 2, 9, 8, 7, 4, 1, 210, 25 ];
var stringArray = [ "Tom", "Jerry", "Popeye", "Olive", "Bluto" ];
var minNumber = numberArray.getMin(); /* returns 1*/
var minString = stringArray.getMin(); /* returns "Bluto"*/
var maxNumber = numberArray.getMax(); /* returns 210*/
var maxString = stringArray.getMax(); /* returns "Tom"*/
var myArray = [ "hello", "John", "how", "are", "you" ];
var separatedString = myArray.separateWith(" "); /* returns "hello John how are you"*/
var anotherString = myArray.separateWith("-"); /* returns "hello-John-how-are-you"*/
var yetAnotherString = myArray.separateWith("abc");
/* returns "helloabcJohnabchowabcareabcyou"*/
var myArray = [ "hello", null, undefined, "John", "how", NaN, "are", null, "you" ];
var cleanedString = myArray.clean(null); /* returns [ "hello", undefined, "John", "how", NaN, "are", "you" ]*/
var cleanedString = myArray.clean(undefined); /* returns [ "hello", null, "John", "how", NaN, "are", null, "you" ]*/
To remove all the unwanted values at a time-
var cleanedString = myArray.clean(undefined).clean(NaN).clean(null);
/* returns [ "hello", "John", "how", "are", "you" ]*/
String Methods
var numberArray = [ 5, 4, 1, 2, 9, 8, 7, 4, 1, 210, 25 ];
var stringArray = [ "Tom", "Jerry", "Popeye", "Olive", "Bluto" ];
var minNumber = numberArray.getMin(); /* returns 1*/
var minString = stringArray.getMin(); /* returns "Bluto"*/
var maxNumber = numberArray.getMax(); /* returns 210*/
var maxString = stringArray.getMax(); /* returns "Tom"*/
Miscellaneous
Now, if we keep this into a variable..
var dates = datesBetween(new Date("2018/03/21"),new Date("2018/03/28"));
It returns an array of date objects from 21 March, 2018 to 28 March, 2018. If we iterate through it and append as string it gives the following output-