This is something I haven’t really thought of before, typically when I implement a file upload for an image the preview happens after. However, there is actually a really simple way to get a preview of it before the actual upload happens to the server. Let’s take a look at an example.
Blog
-
Sort array of objects by any property value using Javascript
Javascript contains a built-in array method to sort simple arrays. But I rarely am using simple JavaScript arrays, typically the elements inside my array a complex objects with many different properties. A simple example is a person that perhaps contains a first name, last name, and age. I can see myself wanting to sort by any one of those properties. So how can I sort a JavaScript array that contains complex objects and better yet, not hard-coded and dynamically by any property of my object.
-
How to randomize (shuffle) a JavaScript array
I have rarely wanted to randomize an array with Javascript; however, whenever I do I forget how to do it. Today that day changes, I’m going to write it down to both help my memory as well as have an easy place to find it in the future. Alright, let’s look at a simple solution to randomizing or shuffling a Javascript array.
-
ko.utils.arrayFirst using Knockoutjs and Javascript
So, you’re using KnockoutJS and Javascript and you need to loop an array; are you tired of writing for loops with an if statement followed by break to exit the loop? I know I am, so let’s look at a better way to do it.
This will be a great addition to my list of KnockoutJS tutorials that you should check out. Enough chat, let’s get right to it.
- Create Observable Array
- Using ko.utils.arrayFirst example code
- What is Ko utility functions?
- What is Ko observableArray function?
- How do I sort knockout observable array?
- How do you update items in observableArray knockout?
- What is $data in Ko?
- How do you clear a knockout observable array?
- What is an observable array?
-
String Extract Extension Method with C#
The following extension method is probably one of my all time favorite things to do with strings: parse out text between a start and end delimiter.