HTML5 localStorage check for null or undefined

When saving values in localStorage those values are saved as string.  There are some guidelines when checking for undefined vs. null. 

Checking localStorage.variableName === undefined is the way to checked it.

Checking getItem("variableName") === null is the way to go.

Here is a sample and results in the console.

function testLocalStorage()
{
	console.log('TESTING localStorage.value1')
	if (localStorage.value1 === undefined) 
		console.log('localStorage.value1 - is undefined');

	if (localStorage.value1 === null) 
		console.log('localStorage.value1 - is null');
	
	console.log('\n');			
	console.log('TESTING getItem("value2")');

	var licValue = localStorage.getItem("value2");

	if(licValue === undefined) 
		console.log('getItem(localStorage.value2) - is undefined');

	if(licValue === null) 
		console.log('getItem(localStorage.value2) - is null');			 
}	

*** CONSOLE RESULTS ***

TESTING localStorage.value1
localStorage.value1 - is undefined

TESTING getItem("value2")
getItem(localStorage.value2) - is null

Binaural Beat Meditation Mind Machine with Chakra Colors

I recently released a new mobile app "Subliminal Meditation PRO". I wrote "The Ultimate Meditation App" that includes a Meditation Timer, Binaural Beats, Brain Wave Meditation, Mind Machine, Classical Music tracks, and features not found in retail mind machines such as the Seven Chakra Colors .  Both the Meditation Tracks and the Classical Music Play will both play subliminal messages (you can listen to the entire subliminal message under settings).  

Get it on Google Play and Amazon.

 

Beyond Mediation App Packed with Features:

♦ Nine Binaural Beat Meditation Tracks
♦ Meditation Timer from 1 minute to 24 hours
♦ Brain Wave Meditations Meditation
♦ Light and Sound Mind Machine
♦ Positive Subliminal Messages (Health, Happiness, Wealth)
♦ Solfeggio Frequencies Meditation
♦ Classical Music with Subliminal Suggestions

★ MEDITATION TRACKS ★

☛ Theta Meditation: A Deep Mediation Track with Theta Waves using Binaural Beats in the 5Hz- 7Hz range that entrains your brain into a deep meditative state. Theta waves are associated with deep meditation and can help alleviate anxiety.

☛ Delta Sleep & Meditate: A Deep Sleep Track with Delta Waves using Binaural Beats in the 1Hz- 3.5Hz range that entrains your brain into a deep meditative state. Theta waves are associated with deep meditation and can help alleviate anxiety.

☛ Pink Noise: Softer than White Noise, Pink Noise is a great way to block outside noises and relax and meditate. A great sound to use to help babies sleep.

☛ Relaxing Waves: Relaxing waves great for general relaxation.

☛ Verdi 432Hz Meditation: 432Hz, known as Verdi’s ‘A’ is an alternative tuning that is mathematically * consistent with the universe. Music based on 432Hz transmits beneficial healing energy, because it is a pure tone of math fundamental to nature.

☛ 528Hz Solfeggio - DNA Repair Meditation: A Deep Mediation Solfeggio Track with Theta Waves using Binaural Beats in the 5Hz- 7Hz range that entrains your brain into a deep meditative state.

☛ 852Hz Solfeggio Intuition: A Deep Mediation Solfeggio Track with Theta Waves using Binaural Beats in the 5Hz- 7Hz range that entrains your brain into a deep meditative state.

☛ Solfeggio Frequency Meditations: The Solfeggio sound healing frequencies are believed to have many psychological, emotional, spiritual and physical healing benefits. 528hz is the exact sound frequency used by genetic scientists to repair broken DNA, and to which the genetic blueprint upon which all life is based!

★ MIND MACHINE / LIGHT AND SOUND MACHINE ★

Light and Sound Machines are non-drug tools that have been used for decades to improve Academic and Sports Performances. Most of the top hypnotists and hypnosis centers use Light and Sound Machines to assist their clients into a highly suggestive state

Light and Sound Machines have also been scientifically proven to assist in reducing the symptoms
of Stress and Anxiety, Post Traumatic Stress Disorder (PTSD), Attention Deficit Disorder (ADD), Pre-Menstrual Syndrome (PMS), Chronic Fatigue Syndrome (CFS), Seasonal Affective Disorder (SAD),
Depression, Insomnia, Autism, Chronic Pain and Fibromyalgia.

☛ Light & Sound Brain Wave Entrainment
☛ Each Program is Random. This keeps meditation sessions fresh
☛ Light Frequency matches the range of the sound frequencies
☛ Seasonal Affective Disorder (SAD) Treatment

★ SUBLIMINAL TRACKS ★

Play subliminal tracks "underneath" Meditation Sessions & Classical Music.

Categories:

☛ Abundance & Wealth
☛ Health & Healing
☛ Joy & Happiness

Listen to all the words of any of these Subliminal Tracks. You know exactly what is being said during a Subliminal Meditation Session. The volume of the Subliminal Track can be adjusted to an level below the conscious mind, or at full volume too for a non-subliminal session. The Voice Level setting allows you to set the sound level of the positive affirmations. The vocal track is played "underneath" or "behind" a meditation, nature, or music track on this app.

Subliminal recordings will bypass, your conscious mind, going directly to your sub-conscious mind, where deep and lasting changes can be made in the area of thinking, emotions, health, wealth, and how we view life.

★ SUBLIMINAL MUSIC ★

Listen to Classical Music along with the subliminal track selected under settings. Listening to these classical subliminal tracks is a great way to benefit from subliminal audio during the day.

The Music Player was very interesting to write. It is an HTML5 player that includes Saving last track, last track location, repeat song, random play. 

The Meditation Player is HTML5 audio as well, and it features looping, but not using the LOOP feature of HTML5 since it has gaps. This player uses two HTML5 players (actually 3 including the subliminal track) and cross-fades the tracks to make loop playing possible.  This cross-fade looping technique works well for nature and ambient sounds, but with music you will hear a bit of a change in music tone as it cross-fades, but no gaps.

More information on Google Play and on Today Shapes Tomorrow

DevExtreme / Cordova / PouchDB Mobile App

Back in 2012 I developed a native Android called "Trading Wisdom" for MTR Investors Group.

That app was built using Eclipse and Android SDK.  A few years back I wanted to go down the path of code-once, deploy to many platforms. At that time I started working with DevExtreme (which basically uses Cordova) to build apps.

This updated "Investing / Trading Wisdom" app was another project that I used to learn some additional mobile technologies: IndexDB and PouchDB.  When the app first starts up it takes the quotations from JSON and loads these into an IndexDB using PouchDB as the interface.

You can find this app on Google play. Soon to be launched on iOS.

Technologies:

  • DevExtreme
  • Cordova
  • HTML5
  • IndexDB
  • PouchDB
  • localStorage