lodash orderby method as an option for sorting collections

The lodash orderby method is one of several options in lodash for sorting collections mainly arrays, but also objects in general because it is a collection method rather that just an array method. It works more or less the same way as the lodash sortby method, but it allows for setting the sort orders ( ascending or descending ) of each method that is used to sort the collection object.

However I often just make use of what there is to work with in just native javaScript by itself when it comes to sorting arrays and object keys in general. With that said there is also using just the plain old sort array prototype method when it comes to working with arrays. So this will be a quick post on using the lodash order by method, as well as some vanilla javaScript alternatives.

Read More

Blog plan for 2020

I have made a habit of writing a post on the subject of blogging in general rather than javaScript, and javaScript related topics at the start of a new year. So this will be a yet another blog plan post for the year of 2020. No buddy really seams to read these, but thats okay its more for my sake anyway because it is important for me to know where this site is going, and what the next move should be as I continue going forward with this.

A course change of sorts is needed here, and after giving this some thought I have come to the conclusion that I need to focus more on just one or two general topics rather than trying to gain ground everywhere. My best preforming content seems to be on lodash and functional programing, but much of the content is thin, and desires more attention so that should be one topic at least for that reason. The other topic should be something fun, original, and interesting that might help to improve retention, so that people have a reason to stick around.

I also want to focus on something fun to help me keep from seeing this as a job with a very poor return on investment more often than not. So I think I should work on canvas projects, games, and things I find fun and interesting to at least some extent. Doing so is a good idea for the sake of keeping myself happy rather than just going in whatever dirrection the money might be regardless if I like it or not.

Read More

JS Function basics and much more

In javaScript functions are a central part of much of the code that a javaScript developer will be studying and writing. The basics of functions in javaScript are something that can be quickly picked up in a flash, however there are many other aspects of functions in javaScript that might take longer to get solid. Functions can be used as a way to create reusable segments of code, but there are many different ways of just doing that to begin with. Functions are also used for compartmentalizing massive amounts of code into a kind of module or package, and functions can also be used as a way to create a main application loop.

So this post will be a general overview of functions in javaScript, I will not be getting into every little thing that comes up in detail, but I will be touching base on a wide range of topics relating to functions in javaScript, and I will link to additional content where doing so is called for.

Read More

Wire frames in threejs the basic material and custom canvas solutions

It is often desirable to set a material into a wire frame mode so that just the basic form of the object is apparent without any faces rendered. Many materials in threejs such as the Basic material have a wire frame property that when set to true will render the mesh in as a wire frame. The built in wire frame mode will work okay for the most part, but many might not care for the look of it, so there is a need to look for additional ways to create a wire frame such as using the line material with a custom geometry. This alternative to the wire frame mode of materials will work fine most of the time, but still there might end up being problems with rendering. One major problem has to do with line width not working on certain platforms. So then another solution might involve creating custom textures using canvas elements or data textures that can then be applied to another property of a material such as the map property.

This post will be on the wire frame mode of various materials in threejs, the basic use of the property typically just involves setting a boolean value to true. Sense setting a material into wire frame mode just involves setting a boolean to true, many of the examples here will have to do with various related topics that might come up. I could also take a moment to get into some more complex solutions that will take a bit more to get working. These alternatives to the wire frame mode of materials will result in a similar effect, but with some kind of added benefit when it comes to creating some kind of style when making a final product with a wire frame kind of look.

Read More