Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 508 Bytes

README.md

File metadata and controls

33 lines (23 loc) · 508 Bytes

try.js

Sexy JavaScript fault-tolerant.

var output = document
                .try('querySelector', 'div')
                .try('getAttribute', 'id')
                .try('slice', 0, 5);

console.log(output);

Install

Bower

bower install tryjs --save

Setup

Include the script located on the dist folder.

<script src="dist/try.min.js"></script>

Or use the link CDN

<script src="//cdn.rawgit.com/dayvsonlima/try.js/master/dist/try.min.js"></script>